Better way to wait for build and check exit code
See original GitHub issueFrom here:
I suggest replacing it with a far simpler way:
start “Unity build” /wait “C:\Program Files\Unity\Editor\Unity.exe” -batchmode -buildTarget standalone -projectPath .\src\UnitProject -logfile editor.log -quit
The cmd.exe command start /wait
will not exit until the process you started exits, and it propagates the exit code of that process back to the caller, allowing the Pipeline to fail with an error. Also, the -quit
switch ensures that unity.exe
exits when the build is done.
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
How to wait in bash for several subprocesses to finish, and ...
#!/usr/bin/env bash # Wait for pids to terminate. If one pid exits with # a non zero exit code, send the TERM signal...
Read more >wait for process in pipeline returns wrong exit code
The way to get the behaviour I want is to use a temporary file to capture exit codes from within the asynchronous code....
Read more >How to Fix 'Terminated With Exit Code 1' Error - Komodor
Check if a file listed in the image specification was not found. · In Docker, use the docker stop command to stop the...
Read more >Bash command line exit codes demystified | Enable Sysadmin
The best method for script debugging with this exit status is to issue your command in an interactive shell to see the errors...
Read more >A Guide to System.exit() - Baeldung
exit method suit better for script-based applications or wherever the status codes are interpreted. You can check out the examples provided in ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@AArnott @FejZa consider wrapping the execution in a powershell job. Look at the documentation for Start-Job Get-Job and Wait-Job. You can also get status of things this way, and there are ways to dig deep to get child processes spawned by the jobs.
Fixed in v2.7