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

Enable passing answer to download/overwrite question in _upgradePublisher.sh #16

Merged
Merged
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
30 changes: 23 additions & 7 deletions _updatePublisher.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand Down