fix: error message of Nix.select

This commit is contained in:
2026-01-18 16:53:12 +08:00
parent 9aee36a0e2
commit 208b996627

View File

@@ -115,12 +115,7 @@ export const select = (obj: NixValue, attrpath: NixValue[]): NixValue => {
if (!(key in attrs)) { if (!(key in attrs)) {
throw new Error(`Attribute '${key}' not found`); throw new Error(`Attribute '${key}' not found`);
} }
const cur = force(attrs[forceString(attr)]); const cur = forceAttrs(attrs[forceString(attr)]);
if (!isAttrs(cur)) {
// throw new Error(`Attribute '${forced_key}' not found`);
// FIXME: error
throw new Error(`Attribute not found`);
}
attrs = cur; attrs = cur;
} }