diff options
Diffstat (limited to 'src/cli.zig')
-rw-r--r-- | src/cli.zig | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/cli.zig b/src/cli.zig index ff1a00720..5aa02284d 100644 --- a/src/cli.zig +++ b/src/cli.zig @@ -1131,8 +1131,10 @@ pub const Command = struct { } } + var was_js_like = false; if (options.defaultLoaders.get(extension)) |loader| { if (loader.isJavaScriptLike()) { + was_js_like = true; possibly_open_with_bun_js: { const script_name_to_search = ctx.args.entry_points[0]; @@ -1205,6 +1207,26 @@ pub const Command = struct { if (try RunCommand.exec(ctx, true, false)) { return; } + + Output.prettyErrorln("<r><red>error<r>: Script not found \"<b>{s}<r>\"", .{ + ctx.positionals[0], + }); + Output.flush(); + Global.exit(1); + } + + if (was_js_like) { + Output.prettyErrorln("<r><red>error<r>: Module not found \"<b>{s}<r>\"", .{ + ctx.positionals[0], + }); + Output.flush(); + Global.exit(1); + } else if (ctx.positionals.len > 0) { + Output.prettyErrorln("<r><red>error<r>: File not found \"<b>{s}<r>\"", .{ + ctx.positionals[0], + }); + Output.flush(); + Global.exit(1); } if (FeatureFlags.dev_only) { |