try: fixing stuff

This commit is contained in:
piecka 2025-03-25 09:46:49 +01:00
parent b149b2d733
commit 5c34ee9f23

7
.zshrc
View file

@ -359,7 +359,7 @@ __alias__() {
branch=$(git symbolic-ref --short HEAD 2>/dev/null || echo "detached") branch=$(git symbolic-ref --short HEAD 2>/dev/null || echo "detached")
if [ "$branch" = "detached" ]; then if [ "$branch" = "detached" ]; then
default_branch=$(git config -f $toplevel/.gitmodules submodule.$name.branch || echo "main") default_branch=$(git config -f $toplevel/.gitmodules submodule.$name.branch || echo "main")
echo "${RED}Submodule $name is detached. Checking out $default_branch...${NC}" echo "${RED}Submodule $name is detached. Checking out ${YELLOW} $default_branch${RED}...${NC}"
git checkout $default_branch git checkout $default_branch
else else
echo "${CYAN}Submodule $name is on branch $branch.${NC}" echo "${CYAN}Submodule $name is on branch $branch.${NC}"
@ -387,17 +387,18 @@ __alias__() {
fi fi
else else
echo "${CYAN}No changes to commit.${NC}" echo "${CYAN}No changes to commit.${NC}"
return 1
fi fi
} }
gUpdateModules if gUpdateModules; then
if git push; then if git push; then
echo "${CYAN}Push successful.${NC}" echo "${CYAN}Push successful.${NC}"
else else
echo "${RED}Failed to push changes.${NC}" echo "${RED}Failed to push changes.${NC}"
return 1 return 1
fi fi
fi
} }
gwip() { gwip() {