From d70c5d30691fea148b408c6492ada4d7f8bfb6af Mon Sep 17 00:00:00 2001 From: Hyperling Date: Sat, 12 Sep 2026 12:25:28 -0700 Subject: [PATCH] install, add a remove option. --- install.sh | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/install.sh b/install.sh index 63d4c6e..f9961ed 100755 --- a/install.sh +++ b/install.sh @@ -16,12 +16,13 @@ name_abs="weather-list" ## Parameters ## -while getopts ":gslah" arg; do +while getopts ":gslarh" arg; do case $arg in g) global="Y" ;; s) short="Y" ;; l) long="Y" ;; a) abstract="Y" ;; + r) remove="Y" ;; h) usage ;; *) echo "ERROR: Parameter $OPTARG was not recognized." && usage 1 ;; esac @@ -41,10 +42,16 @@ if [[ "$abstract" == "Y" || ( -z "$short" && -z "$long" ) ]]; then fi cmd="" +if [[ -z "$remove" ]]; then + cmd="cp -v $DIR/prototype.js" +else + cmd="rm -v" +fi + dir="$LOCAL" if [[ "$global" == "Y" ]]; then dir="$GLOBAL" - cmd="sudo" + cmd="sudo $cmd" echo "Requesting sudo privileges... " sudo echo "Success!" fi @@ -53,7 +60,7 @@ fi for prog in $name; do mkdir -pv $dir - $cmd cp -v -svf "$DIR"/prototype.js $dir/$prog + $cmd $dir/$prog done ## Finish ##