From 9e0b293e5a540f9c260d8749e81eb58322b91b65 Mon Sep 17 00:00:00 2001 From: dionmcm Date: Sun, 2 Feb 2020 01:08:01 +1100 Subject: [PATCH 1/2] made _updatePublisher.sh selection clearer --- _updatePublisher.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_updatePublisher.sh b/_updatePublisher.sh index 7307202..2a0234c 100755 --- a/_updatePublisher.sh +++ b/_updatePublisher.sh @@ -35,7 +35,7 @@ if "$upgrade"; then message="Overwrite $jarlocation?" else echo Will place publisher jar here: "$jarlocation" - message="Ok?" + message="Ok (enter 'y' or 'Y' to continue, any other key to cancel) ?" fi read -r -p "$message" response From 00c4a72152b24097ad6fdb6e1a288a704bfd4baa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9tur=20=C3=9E=C3=B3r=20Valdimarsson?= Date: Fri, 3 Apr 2020 11:43:39 +0200 Subject: [PATCH 2/2] Enable passing answer to overwrite question in _upgradePublisher.sh as a flag --- _updatePublisher.sh | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/_updatePublisher.sh b/_updatePublisher.sh index d953ea9..2d5c09f 100755 --- a/_updatePublisher.sh +++ b/_updatePublisher.sh @@ -9,6 +9,20 @@ if ! type "curl" > /dev/null; then exit 1 fi +FORCE=false + +while :; do + case $1 in + -f|--force) FORCE=true ;; + --) + shift + break + ;; + *) break + esac + shift +done + publisher="$input_cache_path$publisher_jar" if test -f "$publisher"; then echo "IG Publisher FOUND in input-cache" @@ -31,15 +45,17 @@ else fi fi -if "$upgrade"; then - message="Overwrite $jarlocation? (Y/N) " -else - echo Will place publisher jar here: "$jarlocation" - message="Ok? (Y/N) " +if [[ "$FORCE" != true ]]; then + if "$upgrade"; then + message="Overwrite $jarlocation? (Y/N) " + else + echo Will place publisher jar here: "$jarlocation" + message="Ok? (Y/N) " + fi + read -r -p "$message" response fi -read -r -p "$message" response -if [[ "$response" =~ ^([yY])$ ]]; then +if [[ "$FORCE" ]] || [[ "$response" =~ ^([yY])$ ]]; then echo "Downloading most recent publisher to $jarlocationname - it's ~100 MB, so this may take a bit" # wget "https://fhir.github.io/latest-ig-publisher/org.hl7.fhir.publisher.jar" -O "$jarlocation" curl $dlurl -o "$jarlocation" --create-dirs