diff --git a/libexec/shsh-install b/libexec/shsh-install index 60685a0..3ab503d 100755 --- a/libexec/shsh-install +++ b/libexec/shsh-install @@ -4,7 +4,7 @@ # # Usage: shsh install [site]/[@ref] [/] # [-h|--hook ] [-v|--variable =] [--ssh] -# [--nocleanup] [--force] +# [--nocleanup] [-f|--force] # # Options: # -h, --hook [=] @@ -15,7 +15,7 @@ # useful for setting up files for linking # --nocleanup do not perform cleanup (shsh uninstall ) # even if something failed in the installination process -# --force force the installation even if the package exists +# -f, --force force the installation even if the package exists # --ssh use ssh protocal instead of https # # --verbose display more info for some commands @@ -74,7 +74,7 @@ if [ "$#" != 0 ]; then --nocleanup) no_cleanup="true" ;; - --force) + -f|--force) force_install="true" ;; -h|--hook) @@ -130,13 +130,6 @@ if [ "$#" != 0 ]; then shift # remove the EOL token fi -# echo "\$hook_pre=$hook_pre" -# echo "\$hook_post=$hook_post" -# echo "\$hook_uninstall=$hook_uninstall" -# echo "\$hook_plus_x=$hook_plus_x" -# echo "\$hook_all_plus_x=$hook_all_plus_x" -# echo "\$@=$@" - if [ "$#" -lt 1 ] || [ "$#" -gt 2 ]; then shsh-help install @@ -222,6 +215,7 @@ trap on_exit EXIT ## INSTALLING +[ -n "$force_install" ] && shsh uninstall "$folder" >/dev/null 2>&1 || true # only perform link if clone is successful (and package not exists before) if ! shsh-_clone "$use_ssh" "$site" "$package" "$ref" "$folder"; then exit diff --git a/man/man1/shsh-install.1 b/man/man1/shsh-install.1 index 5d9d094..c180625 100644 --- a/man/man1/shsh-install.1 +++ b/man/man1/shsh-install.1 @@ -9,7 +9,7 @@ shsh \- manual page for shsh v2.2.1 Installs a package from github (or a custom site) .TP [\-h|\-\-hook ] [\-v|\-\-variable =] [\-\-ssh] -[\-\-nocleanup] +[\-\-nocleanup] [\-f|\-\-force] .SH OPTIONS .HP \fB\-h\fR, \fB\-\-hook\fR [=] @@ -26,6 +26,9 @@ useful for setting up files for linking do not perform cleanup (shsh uninstall ) even if something failed in the installination process .TP +\fB\-f\fR, \fB\-\-force\fR +force the installation even if the package exists +.TP \fB\-\-ssh\fR use ssh protocal instead of https .TP diff --git a/man/man1/shsh.1 b/man/man1/shsh.1 index abd5e64..03b8ebd 100644 --- a/man/man1/shsh.1 +++ b/man/man1/shsh.1 @@ -119,7 +119,7 @@ SHELL: sh, bash, zsh, fish, etc. Installs a package from github (or a custom site) .TP [\-h|\-\-hook ] [\-v|\-\-variable =] [\-\-ssh] -.SH "\-\-NOCLEANUP" +[\-\-nocleanup] [\-f|\-\-force] .SS OPTIONS .HP \fB\-h\fR, \fB\-\-hook\fR [=] @@ -136,6 +136,9 @@ useful for setting up files for linking do not perform cleanup (shsh uninstall ) even if something failed in the installination process .TP +\fB\-f\fR, \fB\-\-force\fR +force the installation even if the package exists +.TP \fB\-\-ssh\fR use ssh protocal instead of https .TP