refactor of installation methods for rollback and updates

v2.1.0
This commit is contained in:
pyr0ball 2023-04-11 12:07:58 -07:00
parent 34e702e4ab
commit 13eb96cb32

View file

@ -4,7 +4,7 @@
################################################################### ###################################################################
# initial vars # initial vars
VERSION=2.0.1 VERSION=2.1.0
scripttitle="Pyr0ball's Reductive Bash Library Installer - v$VERSION" scripttitle="Pyr0ball's Reductive Bash Library Installer - v$VERSION"
source ${rundir}/functions source ${rundir}/functions
scriptname="${BASH_SOURCE[0]##*/}" scriptname="${BASH_SOURCE[0]##*/}"
@ -246,7 +246,6 @@ userinstall(){
fi fi
boxborder "${grn}Please be sure to run ${lyl}sensors-detect --auto${grn} after installation completes${dfl}" boxborder "${grn}Please be sure to run ${lyl}sensors-detect --auto${grn} after installation completes${dfl}"
success "\t${red}P${lrd}R${ylw}b${ong}L ${lyl}Installed!${dfl}"
} }
globalinstall(){ globalinstall(){
@ -315,7 +314,6 @@ globalinstall(){
/bin/bash ${rundir_absolute}/extra.installs /bin/bash ${rundir_absolute}/extra.installs
fi fi
#clear #clear
success " [${red}P${lrd}R${ylw}b${ong}L ${lyl}Installed${dfl}]"
} }
@ -354,9 +352,9 @@ remove-arbitrary(){
} }
update(){ update(){
remove remove-arbitrary
git stash -m "$pretty_date stashing changes before update to latest" git stash -m "$pretty_date stashing changes before update to latest"
git fetch && git pull git fetch && git pull --recurse-submodules
install install
} }
@ -367,21 +365,24 @@ update(){
case $1 in case $1 in
-i | --install) -i | --install)
install install
success " [${red}P${lrd}R${ylw}b${ong}L ${lyl}Installed${dfl}]"
;; ;;
-r | --remove) -r | --remove)
remove remove
success " [${red}P${lrd}R${ylw}b${ong}L ${lyl}Removed${dfl}]"
;; ;;
-d | --dependencies) -d | --dependencies)
install-deps install-deps
success "${red}P${lrd}R${ylw}b${ong}L${dfl} Dependencies installed!"
;; ;;
-u | --update) -u | --update)
update update
exit 0 success " [${red}P${lrd}R${ylw}b${ong}L ${lyl}Updated${dfl}]"
;; ;;
-f | --force) -f | --force)
remove-arbitrary remove-arbitrary
install install
exit 0 success " [${red}P${lrd}R${ylw}b${ong}L ${lyl}Installed${dfl}]"
;; ;;
-h | --help) -h | --help)
usage usage