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

bun run <missing.ts> should exits with non-0 #4011

Closed
azu opened this issue Aug 6, 2023 · 2 comments
Closed

bun run <missing.ts> should exits with non-0 #4011

azu opened this issue Aug 6, 2023 · 2 comments
Labels
bug Something isn't working good first issue Something that would be good for new contributors

Comments

@azu
Copy link

azu commented Aug 6, 2023

What version of Bun is running?

0.7.2

What platform is your computer?

Darwin 22.6.0 arm64 arm

What steps can reproduce the bug?

$ bun run missing.ts
error: missing script "missing.ts"
$ echo $?
0

What is the expected behavior?

Exit status should be non-zero.

Node.js: 1

❯ node missing.js
node:internal/modules/cjs/loader:1080
  throw err;
  ^

Error: Cannot find module '/Users/azu/ghq/github.com/azu/bluenotiondb/missing.js'
    at Module._resolveFilename (node:internal/modules/cjs/loader:1077:15)
    at Module._load (node:internal/modules/cjs/loader:922:27)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
    at node:internal/main/run_main_module:23:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

Node.js v18.17.0

❯ echo $?
1

Deno: 130

❯ deno run missing.ts
error: Module not found "file:///Users/azu/ghq/github.com/azu/bluenotiondb/missing.ts".
❯ echo $?
130

What do you see instead?

bun run missing.ts exits with 0.

Additional information

This behaviour caused problems where CI would pass even if the wrong file name was specified.

bun run show error: missing script "index.ts", but this CI is passed.
image

@azu azu added the bug Something isn't working label Aug 6, 2023
@azu azu changed the title bun run <missing.ts> should exit non-0 bun run <missing.ts> should exits with non-0 Aug 6, 2023
@robobun robobun changed the title bun run <missing.ts> should exits with non-0 bun run <missing.ts> should exits with non-0 Aug 6, 2023
@Jarred-Sumner
Copy link
Collaborator

Jarred-Sumner commented Aug 6, 2023

yes it should, thank you for flagging

@Jarred-Sumner Jarred-Sumner added the good first issue Something that would be good for new contributors label Aug 6, 2023
@Jarred-Sumner
Copy link
Collaborator

Fixed by @YashoSharma in #4026

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Something that would be good for new contributors
Projects
None yet
Development

No branches or pull requests

2 participants