mirror of
https://gitlab.com/amrron/setup-scripts.git
synced 2026-10-17 01:54:00 -04:00
added git version checking to all scripts
This commit is contained in:
+37
-4
@@ -1,12 +1,45 @@
|
||||
#!/bin/bash
|
||||
################################################################################
|
||||
################################################################################
|
||||
################# AmRRON PAT Setup and Alias Manager v1.0 ##################
|
||||
################# AmRRON PAT Setup and Alias Manager v1.1 ##################
|
||||
################# Created by TB-14 ##################
|
||||
################# 26 JAN 25 ##################
|
||||
################# 27 JAN 25 ##################
|
||||
################################################################################
|
||||
################################################################################
|
||||
|
||||
function check_for_updates() {
|
||||
ACTION='\033[1;90m'
|
||||
FINISHED='\033[1;96m'
|
||||
READY='\033[1;92m'
|
||||
NOCOLOR='\033[0m' # No Color
|
||||
ERROR='\033[0;31m'
|
||||
|
||||
echo
|
||||
echo -e ${ACTION}Checking Git repo
|
||||
echo -e =======================${NOCOLOR}
|
||||
BRANCH=$(git rev-parse --abbrev-ref HEAD)
|
||||
if [ "$BRANCH" != "master" ]
|
||||
then
|
||||
echo -e ${ERROR}Not on master. Aborting. ${NOCOLOR}
|
||||
echo
|
||||
exit 0
|
||||
fi
|
||||
|
||||
|
||||
git fetch
|
||||
HEADHASH=$(git rev-parse HEAD)
|
||||
UPSTREAMHASH=$(git rev-parse master@{upstream})
|
||||
|
||||
if [ "$HEADHASH" != "$UPSTREAMHASH" ]
|
||||
then
|
||||
echo -e ${ERROR}You are not running the most current version of these scripts. Aborting.${NOCOLOR}
|
||||
echo -e ${ERROR}Please run "git pull" from the setup-scripts directory to receive updates.${NOCOLOR}
|
||||
exit 0
|
||||
else
|
||||
echo -e ${FINISHED}Current branch is up to date with origin/master.${NOCOLOR}
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
function set_screen_size() {
|
||||
screen_size=$(xdpyinfo | grep dimensions | \
|
||||
@@ -487,9 +520,9 @@ fi
|
||||
|
||||
|
||||
|
||||
|
||||
check_for_updates
|
||||
set_screen_size
|
||||
check_repo_version
|
||||
#check_repo_version
|
||||
dep_check
|
||||
getardoptools_install
|
||||
skip_setup
|
||||
|
||||
Reference in New Issue
Block a user