try: fixing stuff

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

17
.zshrc
View file

@ -359,7 +359,7 @@ __alias__() {
branch=$(git symbolic-ref --short HEAD 2>/dev/null || echo "detached")
if [ "$branch" = "detached" ]; then
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
else
echo "${CYAN}Submodule $name is on branch $branch.${NC}"
@ -387,16 +387,17 @@ __alias__() {
fi
else
echo "${CYAN}No changes to commit.${NC}"
return 1
fi
}
gUpdateModules
if git push; then
echo "${CYAN}Push successful.${NC}"
else
echo "${RED}Failed to push changes.${NC}"
return 1
if gUpdateModules; then
if git push; then
echo "${CYAN}Push successful.${NC}"
else
echo "${RED}Failed to push changes.${NC}"
return 1
fi
fi
}