1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-27 16:51:15 +02:00

Use Value::normalType on all forced values instead of Value::type

This commit is contained in:
Silvan Mosberger 2020-12-12 02:09:10 +01:00
parent 9f056f7afd
commit 22ead43a0b
No known key found for this signature in database
GPG key ID: E8F1E9EAD284E17D
15 changed files with 199 additions and 213 deletions

View file

@ -97,10 +97,10 @@ struct CmdEval : MixJSON, InstallableCommand
recurse = [&](Value & v, const Pos & pos, const Path & path)
{
state->forceValue(v);
if (v.type == tString)
if (v.normalType() == nString)
// FIXME: disallow strings with contexts?
writeFile(path, v.string.s);
else if (v.type == tAttrs) {
else if (v.normalType() == nAttrs) {
if (mkdir(path.c_str(), 0777) == -1)
throw SysError("creating directory '%s'", path);
for (auto & attr : *v.attrs)