Simple Git & GitHub CLI Shell Scripts

refactor[utils]: More concise status return

+5 -10
+1 -2
utils/check_branch.sh
··· 3 3 # Check if the branch exists 4 4 function is_a_git_branch { 5 5 git rev-parse --verify "$1" >/dev/null 2>&1 6 - return $? 7 - } 6 + }
+1 -2
utils/check_connection.sh
··· 3 3 # function for connection check 4 4 function connected { 5 5 $SUDO ping -c 1 github.com &>/dev/null 6 - return $? 7 6 } 8 7 9 8 # Check for internet connectivity to GitHub ··· 12 11 echo "${BOLD} This won't work, you are offline !${RESET}" 13 12 exit 0 14 13 fi 15 - } 14 + }
+1 -2
utils/check_gh.sh
··· 10 10 11 11 function gh_installed { 12 12 gh --version >/dev/null 2>&1 13 - return $? 14 - } 13 + }
+1 -2
utils/check_git.sh
··· 3 3 # Check if inside a git repo 4 4 function is_a_git_repo { 5 5 git rev-parse --is-inside-work-tree >/dev/null 2>&1 6 - return $? 7 - } 6 + }
+1 -2
utils/check_remote.sh
··· 2 2 3 3 function has_remote { 4 4 git remote -v | grep -q . 5 - return $? 6 - } 5 + }