Fix template checking

This commit is contained in:
Eelco Dolstra 2022-06-01 13:38:17 +02:00
parent 6285c91619
commit da553de7b1
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE

View file

@ -450,7 +450,9 @@ struct CmdFlakeCheck : FlakeCommand
if (auto attr = v.attrs->get(state->symbols.create("path"))) {
if (attr->name == state->symbols.create("path")) {
PathSet context;
state->coerceToStorePath(attr->pos, *attr->value, context);
auto path = state->coerceToPath(attr->pos, *attr->value, context);
if (!path.pathExists())
throw Error("template '%s' refers to a non-existent path '%s'", attrPath, path);
// TODO: recursively check the flake in 'path'.
}
} else