fix bun --bun run folder

This commit is contained in:
pfg
2025-01-17 20:18:55 -08:00
parent 288f256ce4
commit 477fc87e6a
2 changed files with 3 additions and 10 deletions

View File

@@ -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("<r><yellow>warn<r>: Filters are ignored for auto command", .{});

View File

@@ -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