aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/cli.zig8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/cli.zig b/src/cli.zig
index 40b59b928..8974704db 100644
--- a/src/cli.zig
+++ b/src/cli.zig
@@ -963,7 +963,13 @@ pub const Command = struct {
Global.configureAllocator(.{ .long_running = true });
- BunJS.Run.boot(ctx, file, ctx.allocator.dupe(u8, file_path) catch unreachable) catch |err| {
+ // the case where this doesn't work is if the script name on disk doesn't end with a known JS-like file extension
+ var absolute_script_path = std.os.getFdPath(file.handle, &script_name_buf) catch break :possibly_open_with_bun_js;
+ BunJS.Run.boot(
+ ctx,
+ file,
+ absolute_script_path,
+ ) catch |err| {
if (Output.enable_ansi_colors) {
ctx.log.printForLogLevelWithEnableAnsiColors(Output.errorWriter(), true) catch {};
} else {