Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New --publisher flag download only publisher.jar #11

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions _updatePublisher.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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) "
Expand All @@ -87,15 +89,16 @@ 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
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
Expand Down