From d4ed8f8b60f6d4aea79d49319de94cc6a6304716 Mon Sep 17 00:00:00 2001 From: RiskyMH Date: Thu, 23 Jan 2025 17:42:19 +0100 Subject: [PATCH] bun run load `bunfig.toml` to decide if to force bun --- src/cli/run_command.zig | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/cli/run_command.zig b/src/cli/run_command.zig index a09dcb0e8f82d7..6195e22d80ce61 100644 --- a/src/cli/run_command.zig +++ b/src/cli/run_command.zig @@ -1397,6 +1397,10 @@ pub const RunCommand = struct { // setup + if (!ctx.debug.loaded_bunfig) { + bun.CLI.Arguments.loadConfigPath(ctx.allocator, true, "bunfig.toml", ctx, .RunCommand) catch {}; + } + const force_using_bun = ctx.debug.run_in_bun; var ORIGINAL_PATH: string = ""; var this_transpiler: transpiler.Transpiler = undefined; @@ -1404,10 +1408,6 @@ pub const RunCommand = struct { try configurePathForRun(ctx, root_dir_info, &this_transpiler, &ORIGINAL_PATH, root_dir_info.abs_path, force_using_bun); this_transpiler.env.map.put("npm_command", "run-script") catch unreachable; - if (!ctx.debug.loaded_bunfig) { - bun.CLI.Arguments.loadConfigPath(ctx.allocator, true, "bunfig.toml", ctx, .RunCommand) catch {}; - } - // check for empty command if (target_name.len == 0) {