Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create runsample.bat script for Windows (#275)
For those of us still using Windows without WSL, B4W... While I was at it, I've also fixed a few shellcheck warnings in the original runsample script and made it exit upon encountering an empty string.
- Loading branch information
Showing
2 changed files
with
28 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
@if "%DEBUG%"=="" @echo off | ||
:: Run one of the samples. | ||
:: The first argument must be the name of the sample task (e.g. echo). | ||
:: Any remaining arguments are forwarded to the sample's argv. | ||
|
||
if "%OS%"=="Windows_NT" setlocal EnableDelayedExpansion | ||
|
||
set TASK=%~1 | ||
|
||
set SAMPLE=false | ||
if defined TASK if not "!TASK: =!"=="" if exist "samples\%TASK%\*" set SAMPLE=true | ||
|
||
if "%SAMPLE%"=="false" ( | ||
echo Unknown sample: '%TASK%' | ||
exit /b 1 | ||
) | ||
|
||
set ARGS=%* | ||
set ARGS=!ARGS:*%1=! | ||
if "!ARGS:~0,1!"==" " set ARGS=!ARGS:~1! | ||
|
||
call gradlew --quiet ":samples:%TASK%:installDist" && call "samples\%TASK%\build\install\%TASK%\bin\%TASK%" %ARGS% | ||
|
||
if "%OS%"=="Windows_NT" endlocal |