Fix priority order

This commit is contained in:
Colin McDonnell
2023-08-15 18:19:36 -07:00
parent 8a3f85c81a
commit 94e5823bbd

View File

@@ -299,18 +299,6 @@ pub const Arguments = struct {
if (comptime cmd.readGlobalConfig()) brk: {
if (ctx.has_loaded_global_config) break :brk;
if (getRootBunfigPath(&config_buf)) |path| {
Output.debug("trying to load {s}\n", .{path});
const success = loadConfigPath(allocator, true, path, ctx, comptime cmd) catch false;
if (success) {
Output.debug("successfully loaded global bunfig\n", .{});
ctx.has_loaded_global_config = true;
break :brk;
} else {
Output.debug("failed to load global bunfig\n", .{});
}
}
if (getRootBunJSONPath(&config_buf)) |path| {
Output.debug("trying to load {s}\n", .{path});
const success = loadConfigPath(allocator, true, path, ctx, comptime cmd) catch false;
@@ -322,6 +310,18 @@ pub const Arguments = struct {
Output.debug("failed to load global bun.json\n", .{});
}
}
if (getRootBunfigPath(&config_buf)) |path| {
Output.debug("trying to load {s}\n", .{path});
const success = loadConfigPath(allocator, true, path, ctx, comptime cmd) catch false;
if (success) {
Output.debug("successfully loaded global bunfig\n", .{});
ctx.has_loaded_global_config = true;
break :brk;
} else {
Output.debug("failed to load global bunfig\n", .{});
}
}
}
var config_path: [:0]u8 = undefined;