get auto and prefer from install expr (#7624)

This commit is contained in:
Dylan Conway
2023-12-13 03:11:03 -08:00
committed by GitHub
parent 9fc12a1244
commit efb2cb5871

View File

@@ -302,7 +302,7 @@ pub const Bunfig = struct {
break :brk install_;
};
if (json.get("auto")) |auto_install_expr| {
if (_bun.get("auto")) |auto_install_expr| {
if (auto_install_expr.data == .e_string) {
this.ctx.debug.global_cache = options.GlobalCache.Map.get(auto_install_expr.asString(this.allocator) orelse "") orelse {
try this.addError(auto_install_expr.loc, "Invalid auto install setting, must be one of true, false, or \"force\" \"fallback\" \"disable\"");
@@ -325,7 +325,7 @@ pub const Bunfig = struct {
}
}
if (json.get("prefer")) |prefer_expr| {
if (_bun.get("prefer")) |prefer_expr| {
try this.expect(prefer_expr, .e_string);
if (Prefer.get(prefer_expr.asString(bun.default_allocator) orelse "")) |setting| {