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 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\
|
||||||
|
SET skipPrompts=false
|
||||||
|
|
||||||
set update_bat_url=https://raw.githubusercontent.com/FHIR/sample-ig/master/_updatePublisher.bat
|
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 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_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 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 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
|
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
|
FOR %%x IN ("%CD%") DO SET upper_path=%%~dpx
|
||||||
@ -37,18 +40,27 @@ IF NOT EXIST "%input_cache_path%%publisher_jar%" (
|
|||||||
|
|
||||||
:create
|
:create
|
||||||
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) "
|
IF "%skipPrompts%"=="true" (
|
||||||
IF /I "%create%"=="Y" (
|
SET create="Y"
|
||||||
|
) ELSE (
|
||||||
|
SET /p create="Ok? (Y/N) "
|
||||||
|
)
|
||||||
|
IF /I %create%=="Y" (
|
||||||
MKDIR "%input_cache_path%" 2> NUL
|
MKDIR "%input_cache_path%" 2> NUL
|
||||||
GOTO:download
|
GOTO:download
|
||||||
)
|
)
|
||||||
GOTO:done
|
GOTO:done
|
||||||
|
|
||||||
:upgrade
|
:upgrade
|
||||||
SET /p overwrite="Overwrite %jarlocation%? (Y/N) "
|
IF "%skipPrompts%"=="true" (
|
||||||
IF /I "%overwrite%"=="Y" (
|
SET overwrite="Y"
|
||||||
|
) ELSE (
|
||||||
|
SET /p overwrite="Overwrite %jarlocation%? (Y/N) "
|
||||||
|
)
|
||||||
|
|
||||||
|
IF /I %overwrite%=="Y" (
|
||||||
GOTO:download
|
GOTO:download
|
||||||
)
|
)
|
||||||
GOTO:done
|
GOTO:done
|
||||||
|
|
||||||
:download
|
:download
|
||||||
@ -82,7 +94,6 @@ GOTO done
|
|||||||
:done
|
:done
|
||||||
|
|
||||||
REM Download all batch files (and this one with a new name)
|
REM Download all batch files (and this one with a new name)
|
||||||
ECHO Updating this file...
|
|
||||||
|
|
||||||
SETLOCAL DisableDelayedExpansion
|
SETLOCAL DisableDelayedExpansion
|
||||||
|
|
||||||
@ -95,7 +106,8 @@ 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(\"%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" }
|
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
|
start copy /y "_updatePublisher.new.bat" "_updatePublisher.bat" ^&^& del "_updatePublisher.new.bat" ^&^& exit
|
||||||
REM ============================
|
REM ============================
|
||||||
|
|
||||||
PAUSE
|
PAUSE
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user