Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Propagate exit code correctly in Windows wrapper batch script #13048

Conversation

HertzDevil
Copy link
Contributor

On Windows, the bin\crystal.ps1 wrapper script already writes the compiler's exit code to $LASTEXITCODE inside a PowerShell session. The bin\crystal.bat wrapper script, on the other hand, invokes the PowerShell script through the -Command command-line argument, in which case PowerShell exits with status 0 or 1 by default. This PR ensures that %ERRORLEVEL% is also correctly set inside a command prompt session.

@HertzDevil HertzDevil added kind:bug A bug in the code. Does not apply to documentation, specs, etc. topic:infrastructure platform:windows Windows support based on the MSVC toolchain / Win32 API labels Feb 6, 2023
@straight-shoota straight-shoota added this to the 1.8.0 milestone Feb 6, 2023
@straight-shoota straight-shoota merged commit 33b55a4 into crystal-lang:master Feb 8, 2023
@HertzDevil HertzDevil deleted the bug/windows-wrapper-exit-code branch February 10, 2023 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:bug A bug in the code. Does not apply to documentation, specs, etc. platform:windows Windows support based on the MSVC toolchain / Win32 API topic:infrastructure
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants