We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
1.1.8+89d25807f
Darwin 23.3.0 arm64 arm
in Bun shell, I believe there's an issue with some commands, where even if they fail, they allow execution of subsequent instructions. Example:
import {$} from "bun"; try { await $`cd non-existent-directory && echo " This should not be printed?"` }catch (e) { console.log("error"); }
the output is: cd: not a directory: non-existent-directory This should not be printed?
cd: not a directory: non-existent-directory This should not be printed?
However this does not happen with all commands, for example
import {$} from "bun"; try { await $`cat non-existent-directory && echo " This should not be printed?"` }catch (e) { console.log("error"); }
prints:
cat: non-existent-directory: No such file or directory error
Finally, if the instructions are on 2 lines, then the previous return code is always ignored (which is also the case in bash):
import {$} from "bun"; try { await $`cat non-existent-directory echo " This should not be printed?"` }catch (e) { console.log("error"); }
but it would be nice to have a behavior similar to set -euo pipefail (maybe by default or at least opt-in).
set -euo pipefail
No response
The text was updated successfully, but these errors were encountered:
This looks like a bug where cd is returning the wrong exit code, otherwise && symbol works:
cd
&&
bun -e 'await Bun.$`ls lskdjfksjdflksdf && echo cant see this`.throws(false)' >> ls: lskdjfksjdflksdf: No such file or directory
As for set -euo pipefail we should definitely add this
Sorry, something went wrong.
zackradisic
Successfully merging a pull request may close this issue.
What version of Bun is running?
1.1.8+89d25807f
What platform is your computer?
Darwin 23.3.0 arm64 arm
What steps can reproduce the bug?
in Bun shell, I believe there's an issue with some commands, where even if they fail, they allow execution of subsequent instructions. Example:
the output is:
cd: not a directory: non-existent-directory This should not be printed?
However this does not happen with all commands, for example
prints:
Finally, if the instructions are on 2 lines, then the previous return code is always ignored (which is also the case in bash):
but it would be nice to have a behavior similar to
set -euo pipefail
(maybe by default or at least opt-in).What is the expected behavior?
No response
What do you see instead?
No response
Additional information
No response
The text was updated successfully, but these errors were encountered: