From 477fc87e6abedf37c39f253cbdb17ca9aac15acc Mon Sep 17 00:00:00 2001 From: pfg Date: Fri, 17 Jan 2025 20:18:55 -0800 Subject: [PATCH] fix bun --bun run folder --- src/cli.zig | 7 ------- src/cli/run_command.zig | 6 +++--- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/src/cli.zig b/src/cli.zig index 19794c7191..47b2ccd576 100644 --- a/src/cli.zig +++ b/src/cli.zig @@ -2271,7 +2271,6 @@ pub const Command = struct { break :brk null; }; - const force_using_bun = ctx.debug.run_in_bun; var did_check = false; if (default_loader) |loader| { if (loader.canBeRunByBun()) { @@ -2283,12 +2282,6 @@ pub const Command = struct { } } - if (force_using_bun and !did_check) { - if (maybeOpenWithBunJS(ctx)) { - return; - } - } - if (ctx.positionals.len > 0 and extension.len == 0) { if (ctx.filters.len > 0) { Output.prettyln("warn: Filters are ignored for auto command", .{}); diff --git a/src/cli/run_command.zig b/src/cli/run_command.zig index 78fbbf3c7e..653af6102f 100644 --- a/src/cli/run_command.zig +++ b/src/cli/run_command.zig @@ -1301,12 +1301,12 @@ pub const RunCommand = struct { return true; } - if (!did_try_open_with_bun_js and (log_errors or force_using_bun)) { + if (!did_try_open_with_bun_js and log_errors) { if (script_name_to_search.len > 0) { possibly_open_with_bun_js: { const ext = std.fs.path.extension(script_name_to_search); var has_loader = false; - if (!force_using_bun) { + { if (options.defaultLoaders.get(ext)) |load| { has_loader = true; if (!load.canBeRunByBun()) @@ -1345,7 +1345,7 @@ pub const RunCommand = struct { const file = file_ catch break :possibly_open_with_bun_js; - if (!force_using_bun) { + { // Due to preload, we don't know if they intend to run // this as a script or as a regular file // once we know it's a file, check if they have any preloads