some color changes

This commit is contained in:
piecka 2025-03-25 09:55:51 +01:00
parent 625565e787
commit b69b3efd2e

20
.zshrc
View file

@ -1,4 +1,3 @@
#
# ─< Check if the given command exists silently >─────────────────────────────────────────
command_exists() {
command -v "$@" >/dev/null 2>&1
@ -31,6 +30,7 @@ _MESSAGES=(
RED='\033[0;31m'
YELLOW='\033[0;33m'
CYAN='\033[0;36m'
GREEN='\033[1;32m'
NC='\033[0m' # No Color
BOLD='\033[1m'
@ -367,36 +367,36 @@ __alias__() {
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}"
echo "${GREEN}Submodule $name is on branch $branch.${NC}"
fi
'
echo "${YELLOW}${BOLD}| git submodule foreach git pull --recurse-submodule |${NC}"
echo "${YELLOW}git submodule foreach git pull --recurse-submodule${NC}"
git submodule foreach git pull --recurse-submodule &&
echo "${CYAN}-- pulled down submodules recursively${NC}"
echo "${GREEN}-- pulled down submodules recursively --${NC}"
gUpdateModules() {
if ! git diff --exit-code .; then
echo "${YELLOW}Staging changes...${NC}"
echo "${CYAN}Staging changes...${NC}"
git add . || echo "GIT ADD MISSFUNCTION"
sleep 0.3
if git commit -m " update: submodules"; then
echo "${CYAN}Changes committed successfully.${NC}"
echo "${GREEN}Changes committed successfully.${NC}"
else
echo "${RED}Failed to commit changes.${NC}"
echo "${RED}${BOLD}Failed to commit changes.${NC}"
return 1
fi
else
echo "${CYAN}No changes to commit.${NC}"
echo "${GREEN}No changes to commit.${NC}"
return 1
fi
}
if gUpdateModules; then
if git push; then
echo "${CYAN}Push successful.${NC}"
echo "${GREEN}Push successful.${NC}"
else
echo "${RED}Failed to push changes.${NC}"
echo "${RED}${BOLD}Failed to push changes.${NC}"
return 1
fi
fi