Merge pull request #14 from costateixeira/master
self-update from sample IG repo
This commit is contained in:
commit
f60005d7fd
@ -5,6 +5,19 @@ SETLOCAL
|
||||
SET dlurl=https://storage.googleapis.com/ig-build/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%"
|
||||
|
||||
|
||||
:processflags
|
||||
SET ARG=%1
|
||||
@ -43,17 +56,25 @@ IF DEFINED FORCE (
|
||||
GOTO:download
|
||||
)
|
||||
ECHO Will place publisher jar here: %input_cache_path%%publisher_jar%
|
||||
SET /p create="Ok? (Y/N) "
|
||||
IF /I "%create%"=="Y" (
|
||||
IF "%skipPrompts%"=="true" (
|
||||
SET create="Y"
|
||||
) ELSE (
|
||||
SET /p create="Ok? (Y/N) "
|
||||
)
|
||||
IF /I %create%=="Y" (
|
||||
MKDIR "%input_cache_path%" 2> NUL
|
||||
GOTO:download
|
||||
)
|
||||
GOTO:done
|
||||
|
||||
:upgrade
|
||||
IF DEFINED FORCE GOTO:download
|
||||
SET /p overwrite="Overwrite %jarlocation%? (Y/N) "
|
||||
IF /I "%overwrite%"=="Y" (
|
||||
IF "%skipPrompts%"=="true" (
|
||||
SET overwrite="Y"
|
||||
) ELSE (
|
||||
SET /p overwrite="Overwrite %jarlocation%? (Y/N) "
|
||||
)
|
||||
|
||||
IF /I %overwrite%=="Y" (
|
||||
GOTO:download
|
||||
)
|
||||
GOTO:done
|
||||
@ -87,4 +108,24 @@ ECHO This script does not yet support Windows %winver%. Please ask for help on
|
||||
GOTO done
|
||||
|
||||
:done
|
||||
IF NOT DEFINED FORCE PAUSE
|
||||
|
||||
REM Download all batch files (and this one with a new name)
|
||||
|
||||
SETLOCAL DisableDelayedExpansion
|
||||
|
||||
REM ==== For getting the sources online...
|
||||
POWERSHELL -command if ('System.Net.WebClient' -as [type]) {(new-object System.Net.WebClient).DownloadFile(\"%update_bat_url%\",\"_updatePublisher.new.bat\") } else { Invoke-WebRequest -Uri "%update_bat_url%" -Outfile "_updatePublisher.new.bat" }
|
||||
POWERSHELL -command if ('System.Net.WebClient' -as [type]) {(new-object System.Net.WebClient).DownloadFile(\"%gen_bat_url%\",\"_genonce.bat\") } else { Invoke-WebRequest -Uri "%gen_bat_url%" -Outfile "_genonce.bat" }
|
||||
POWERSHELL -command if ('System.Net.WebClient' -as [type]) {(new-object System.Net.WebClient).DownloadFile(\"%gencont_bat_url%\",\"_gencontinuous.bat\") } else { Invoke-WebRequest -Uri "%gencont_bat_url%" -Outfile "_gencontinuous.bat" }
|
||||
|
||||
POWERSHELL -command if ('System.Net.WebClient' -as [type]) {(new-object System.Net.WebClient).DownloadFile(\"%update_sh_url%\",\"_updatePublisher.sh\") } else { Invoke-WebRequest -Uri "%update_sh_url%" -Outfile "_updatePublisher.new.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" }
|
||||
|
||||
ECHO Updating this file...
|
||||
start copy /y "_updatePublisher.new.bat" "_updatePublisher.bat" ^&^& del "_updatePublisher.new.bat" ^&^& exit
|
||||
REM ============================
|
||||
|
||||
IF "%skipPrompts%"=="true" (
|
||||
PAUSE
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user