From 5704d81ddd23365b4da21be1f39d9a2de8dd61a7 Mon Sep 17 00:00:00 2001 From: Josh Mandel Date: Thu, 14 Oct 2021 13:22:20 -0500 Subject: [PATCH] New--publisher flag download only publisher.jar --- _updatePublisher.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/_updatePublisher.sh b/_updatePublisher.sh index f127f66..7352943 100755 --- a/_updatePublisher.sh +++ b/_updatePublisher.sh @@ -14,6 +14,7 @@ gen_sh_url=$scriptdlroot/_genonce.sh update_sh_url=$scriptdlroot/_updatePublisher.sh skipPrompts=false +skipPublisherPrompt=false FORCE=false if ! type "curl" > /dev/null; then @@ -25,6 +26,7 @@ while [ "$#" -gt 0 ]; do case $1 in -f|--force) FORCE=true ;; -y|--yes) skipPrompts=true ; FORCE=true ;; + -p|--publisher) skipPublisherPrompt=true ; FORCE=true ;; *) echo "Unknown parameter passed: $1. Exiting"; exit 1 ;; esac shift @@ -75,7 +77,7 @@ else fi fi -if [[ $skipPrompts == false ]]; then +if [[ $skipPrompts == false ]] && [[ $skipPublisherPrompt == false ]] ; then if [[ $upgrade == true ]]; then message="Overwrite $jarlocation? (Y/N) " @@ -87,7 +89,7 @@ if [[ $skipPrompts == false ]]; then else response=y fi -if [[ $skipPrompts == true ]] || [[ $response =~ ^[yY].*$ ]]; then +if [[ $skipPrompts == true ]] || [[ $skipPublisherPrompt == true ]] || [[ $response =~ ^[yY].*$ ]]; then echo "Downloading most recent publisher to $jarlocationname - it's ~100 MB, so this may take a bit" curl -L $dlurl -o "$jarlocation" --create-dirs @@ -95,7 +97,8 @@ else echo cancelled publisher update fi -if [[ $skipPrompts != true ]]; then +response=n +if [[ $skipPrompts != true ]] && [[ $skipPublisherPrompt != true ]] ; then message="Update scripts? (enter 'y' or 'Y' to continue, any other key to cancel)?" read -r -p "$message" response fi