mirror of
https://github.com/oven-sh/bun
synced 2026-02-17 06:12:08 +00:00
fix bun --bun run folder
This commit is contained in:
@@ -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", .{});
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user