added new run functions for handling dry-runs

This commit is contained in:
pyr0ball 2023-04-26 13:44:21 -07:00
parent 736c767e24
commit 8059bf26ad

View file

@ -124,6 +124,24 @@ usage(){
"You must run as 'root' for this script to automatically resolve dependencies" "You must run as 'root' for this script to automatically resolve dependencies"
} }
run(){
_cmd=$@
if [[ dry_run == true ]] ; then
boxline "DryRun: $_cmd"
else
$_cmd
fi
}
run-and-log(){
_cmd=$@
if [[ dry_run == true ]] ; then
logger "DryRun: $_cmd"
else
logger $_cmd
fi
}
detectvim(){ detectvim(){
# If the vim install directory exists, check for and store the highest numerical value version installed # If the vim install directory exists, check for and store the highest numerical value version installed
if [[ -d /usr/share/vim ]] ; then if [[ -d /usr/share/vim ]] ; then