crystal
crystal copied to clipboard
Exit status consistency issue
trafficstars
When you raise in a file, then check your exit status from the terminal, you'll see 1, but it seems if that raise comes from within a Process, then you don't get that status code:
# test.cr
raise "test"
# run.cr
exit Process.run(
"crystal run test.cr",
shell: true,
input: STDIN,
output: STDOUT,
error: STDERR).exit_status
# $ crystal test.cr; echo $? #=> 1
# $ crystal run.cr; echo $? #=> 0
I expected running crystal run.cr would return a exit status code of 1 but got 0.
[12:12PM] sandbox$ crystal -v
Crystal 0.31.1 (2019-09-30)
LLVM: 6.0.1
Default target: x86_64-apple-macosx
macOS 10.15
ref: https://gitter.im/crystal-lang/crystal?at=5db34583fb4dab784a05c80d