From 3c95307d2a8f85e7d37ba791fac6d3aeb0371ee9 Mon Sep 17 00:00:00 2001 From: Nicholas Freiter Date: Mon, 13 Apr 2020 14:07:17 -0400 Subject: [PATCH] Add -f and --force flag to updatePublisher.bat --- _updatePublisher.bat | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/_updatePublisher.bat b/_updatePublisher.bat index ac9459d..092cb7b 100644 --- a/_updatePublisher.bat +++ b/_updatePublisher.bat @@ -1,8 +1,20 @@ @ECHO OFF + +SETLOCAL + SET dlurl=https://fhir.github.io/latest-ig-publisher/org.hl7.fhir.publisher.jar SET publisher_jar=org.hl7.fhir.publisher.jar 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 IF NOT EXIST "%input_cache_path%%publisher_jar%" ( @@ -26,6 +38,10 @@ IF NOT EXIST "%input_cache_path%%publisher_jar%" ( ) :create +IF DEFINED FORCE ( + MKDIR "%input_cache_path%" 2> NUL + GOTO:download +) ECHO Will place publisher jar here: %input_cache_path%%publisher_jar% SET /p create="Ok? (Y/N) " IF /I "%create%"=="Y" ( @@ -35,6 +51,7 @@ IF /I "%create%"=="Y" ( GOTO:done :upgrade +IF DEFINED FORCE GOTO:download SET /p overwrite="Overwrite %jarlocation%? (Y/N) " IF /I "%overwrite%"=="Y" ( GOTO:download @@ -70,4 +87,4 @@ ECHO This script does not yet support Windows %winver%. Please ask for help on GOTO done :done -PAUSE \ No newline at end of file +IF NOT DEFINED FORCE PAUSE \ No newline at end of file