Simple Git & GitHub CLI Shell Scripts
1#!/bin/bash 2 3function gst { 4 if ! is_a_git_repo; then 5 echo "${BOLD} This won't work, you are not in a git repo !" 6 return 0 7 fi 8 9 # Get the status 10 git status -s 11} 12 13# Resolve the full path to the script's directory 14REAL_PATH="$(dirname "$(readlink -f "$0")")" 15PARENT_DIR="$(dirname "$REAL_PATH")" 16CATEGORY="git.scripts" 17 18HELPS_DIR="$PARENT_DIR/helps/$CATEGORY" 19HELP_FILE="$(basename "$0" .sh)_help.sh" 20 21UTILS_DIR="$PARENT_DIR/utils" 22 23# Import necessary variables and functions 24source "$UTILS_DIR/check_git.sh" 25source "$UTILS_DIR/setup_git.sh" 26source "$UTILS_DIR/check_sudo.sh" 27source "$UTILS_DIR/colors.sh" 28source "$UTILS_DIR/usage.sh" 29 30# Import help file 31source "$HELPS_DIR/$HELP_FILE" 32 33# Usage function to display help 34function usage { 35 show_help "Usage" "${gst_arguments[@]}" 36 show_help "Description" "${gst_descriptions[@]}" 37 show_help "Options" "${gst_options[@]}" 38 show_extra "${gst_extras[@]}" 39 exit 0 40} 41 42# Check if --help is the first argument 43[ "$1" = "--help" ] && usage 44 45# prompt for sudo 46# password if required 47allow_sudo 48 49# Setting up git 50setup_git 51 52# Call gst function 53gst