Add -f and --force flag to updatePublisher.bat

This commit is contained in:
Nicholas Freiter 2020-04-13 14:07:17 -04:00
parent 4a6f113406
commit 3c95307d2a

View File

@ -1,8 +1,20 @@
@ECHO OFF @ECHO OFF
SETLOCAL
SET dlurl=https://fhir.github.io/latest-ig-publisher/org.hl7.fhir.publisher.jar SET dlurl=https://fhir.github.io/latest-ig-publisher/org.hl7.fhir.publisher.jar
SET publisher_jar=org.hl7.fhir.publisher.jar SET publisher_jar=org.hl7.fhir.publisher.jar
SET input_cache_path=%CD%\input-cache\ SET input_cache_path=%CD%\input-cache\
:processflags
SET ARG=%1
IF DEFINED ARG (
IF "%ARG%"=="-f" SET FORCE=true
IF "%ARG%"=="--force" SET FORCE=true
SHIFT
GOTO processflags
)
FOR %%x IN ("%CD%") DO SET upper_path=%%~dpx FOR %%x IN ("%CD%") DO SET upper_path=%%~dpx
IF NOT EXIST "%input_cache_path%%publisher_jar%" ( IF NOT EXIST "%input_cache_path%%publisher_jar%" (
@ -26,6 +38,10 @@ IF NOT EXIST "%input_cache_path%%publisher_jar%" (
) )
:create :create
IF DEFINED FORCE (
MKDIR "%input_cache_path%" 2> NUL
GOTO:download
)
ECHO Will place publisher jar here: %input_cache_path%%publisher_jar% ECHO Will place publisher jar here: %input_cache_path%%publisher_jar%
SET /p create="Ok? (Y/N) " SET /p create="Ok? (Y/N) "
IF /I "%create%"=="Y" ( IF /I "%create%"=="Y" (
@ -35,6 +51,7 @@ IF /I "%create%"=="Y" (
GOTO:done GOTO:done
:upgrade :upgrade
IF DEFINED FORCE GOTO:download
SET /p overwrite="Overwrite %jarlocation%? (Y/N) " SET /p overwrite="Overwrite %jarlocation%? (Y/N) "
IF /I "%overwrite%"=="Y" ( IF /I "%overwrite%"=="Y" (
GOTO:download GOTO:download
@ -70,4 +87,4 @@ ECHO This script does not yet support Windows %winver%. Please ask for help on
GOTO done GOTO done
:done :done
PAUSE IF NOT DEFINED FORCE PAUSE