updatepublisher: add option /f to skip all prompts
This commit is contained in:
parent
66a912ecb8
commit
5fc7ec3ca5
@ -2,15 +2,18 @@
|
||||
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\
|
||||
SET skipPrompts=false
|
||||
|
||||
set update_bat_url=https://raw.githubusercontent.com/FHIR/sample-ig/master/_updatePublisher.bat
|
||||
set gen_bat_url=https://raw.githubusercontent.com/FHIR/sample-ig/master/_genonce.bat
|
||||
set gencont_bat_url=https://raw.githubusercontent.com/FHIR/sample-ig/master/_gencontinuous.bat
|
||||
|
||||
set gencont_sh_url=https://raw.githubusercontent.com/FHIR/sample-ig/master/_gencontinuous.sh
|
||||
set gen_sh_url=https://raw.githubusercontent.com/FHIR/sample-ig/master/_genonce.sh
|
||||
set update_sh_url=https://raw.githubusercontent.com/FHIR/sample-ig/master/_updatePublisher.sh
|
||||
|
||||
IF "%~1"=="/f" SET skipPrompts=true
|
||||
|
||||
ECHO "%skipPrompts%"
|
||||
|
||||
|
||||
FOR %%x IN ("%CD%") DO SET upper_path=%%~dpx
|
||||
@ -37,16 +40,25 @@ IF NOT EXIST "%input_cache_path%%publisher_jar%" (
|
||||
|
||||
:create
|
||||
ECHO Will place publisher jar here: %input_cache_path%%publisher_jar%
|
||||
IF "%skipPrompts%"=="true" (
|
||||
SET create="Y"
|
||||
) ELSE (
|
||||
SET /p create="Ok? (Y/N) "
|
||||
IF /I "%create%"=="Y" (
|
||||
)
|
||||
IF /I %create%=="Y" (
|
||||
MKDIR "%input_cache_path%" 2> NUL
|
||||
GOTO:download
|
||||
)
|
||||
GOTO:done
|
||||
|
||||
:upgrade
|
||||
IF "%skipPrompts%"=="true" (
|
||||
SET overwrite="Y"
|
||||
) ELSE (
|
||||
SET /p overwrite="Overwrite %jarlocation%? (Y/N) "
|
||||
IF /I "%overwrite%"=="Y" (
|
||||
)
|
||||
|
||||
IF /I %overwrite%=="Y" (
|
||||
GOTO:download
|
||||
)
|
||||
GOTO:done
|
||||
@ -82,7 +94,6 @@ GOTO done
|
||||
:done
|
||||
|
||||
REM Download all batch files (and this one with a new name)
|
||||
ECHO Updating this file...
|
||||
|
||||
SETLOCAL DisableDelayedExpansion
|
||||
|
||||
@ -95,6 +106,7 @@ POWERSHELL -command if ('System.Net.WebClient' -as [type]) {(new-object System.N
|
||||
POWERSHELL -command if ('System.Net.WebClient' -as [type]) {(new-object System.Net.WebClient).DownloadFile(\"%gen_sh_url%\",\"_genonce.sh\") } else { Invoke-WebRequest -Uri "%gen_sh_url%" -Outfile "_genonce.sh" }
|
||||
POWERSHELL -command if ('System.Net.WebClient' -as [type]) {(new-object System.Net.WebClient).DownloadFile(\"%gencont_sh_url%\",\"_gencontinuous.sh\") } else { Invoke-WebRequest -Uri "%gencont_sh_url%" -Outfile "_gencontinuous.sh" }
|
||||
|
||||
ECHO Updating this file...
|
||||
start copy /y "_updatePublisher.new.bat" "_updatePublisher.bat" ^&^& del "_updatePublisher.new.bat" ^&^& exit
|
||||
REM ============================
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user