fix some things

This commit is contained in:
piecka 2025-03-25 09:35:50 +01:00
parent f7019152eb
commit 16ae092321

45
.zshrc
View file

@ -354,38 +354,43 @@ __alias__() {
alias gcm="git commit -m" alias gcm="git commit -m"
alias gpu="git push --recurse-submodule=on-demand" alias gpu="git push --recurse-submodule=on-demand"
gsu() { gsu() {
echo "| git submodule foreach git pull --recurse-submodule |" echo "${YELLOW}${BOLD}| git submodule foreach git pull --recurse-submodule |${NC}"
git submodule foreach git pull --recurse-submodule && git submodule foreach git pull --recurse-submodule &&
echo "-- pulled down submodules recursively" echo "${CYAN}-- pulled down submodules recursively${NC}"
echo "| git submodule update --init --recursive |" echo "${YELLOW}| git submodule update --init --recursive |${NC}"
git submodule update --init --recursive git submodule update --init --recursive &&
echo "${CYAN}-- updated submodules recursively${NC}"
echo "-- Checking submodule branches... --" echo "${YELLOW}-- Checking submodule branches... --${NC}"
git submodule foreach ' git submodule foreach '
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 "Submodule $name is detached. Checking out $default_branch..." echo "${RED}Submodule $name is detached. Checking out $default_branch...${NC}"
git checkout $default_branch git checkout $default_branch
else else
echo "Submodule $name is on branch $branch." echo "${CYAN}Submodule $name is on branch $branch.${NC}"
fi fi
' '
if git diff --quiet .; then gUpdateModules() {
echo_info "Staging changes..." if git diff --quiet .; then
git add . echo_info "Staging changes..."
sleep 0.3 git add .
if git commit -m " update: submodules"; then sleep 0.3
echo_info "Changes committed successfully." if git commit -m " update: submodules"; then
echo_info "Changes committed successfully."
else
echo_error "Failed to commit changes."
return 1
fi
else else
echo_error "Failed to commit changes." echo_info "No changes to commit."
return 1
fi fi
else }
echo_info "No changes to commit."
fi gUpdateModules
if git push; then if git push; then
echo_info "Push successful." echo_info "Push successful."
@ -393,6 +398,10 @@ __alias__() {
echo_error "Failed to push changes." echo_error "Failed to push changes."
return 1 return 1
fi fi
# gUpdateModules
error_log
} }
gwip() { gwip() {