try: fixing stuff
This commit is contained in:
parent
b149b2d733
commit
5c34ee9f23
1 changed files with 9 additions and 8 deletions
17
.zshrc
17
.zshrc
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue