From 8059bf26ad0c794be26d6685e56e2764dc8aae35 Mon Sep 17 00:00:00 2001 From: pyr0ball Date: Wed, 26 Apr 2023 13:44:21 -0700 Subject: [PATCH] added new run functions for handling dry-runs --- install.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/install.sh b/install.sh index 6e0480f..2f5919c 100755 --- a/install.sh +++ b/install.sh @@ -124,6 +124,24 @@ usage(){ "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(){ # If the vim install directory exists, check for and store the highest numerical value version installed if [[ -d /usr/share/vim ]] ; then