mirror of
https://github.com/NixOS/nix
synced 2025-06-30 15:48:00 +02:00
Fix eval tests
This commit is contained in:
parent
087584ef4d
commit
95e4376434
4 changed files with 21 additions and 13 deletions
|
@ -1461,12 +1461,15 @@ static RegisterPrimOp primop_baseNameOf({
|
|||
static void prim_dirOf(EvalState & state, const PosIdx pos, Value * * args, Value & v)
|
||||
{
|
||||
PathSet context;
|
||||
auto path = state.coerceToString(pos, *args[0], context, false, false);
|
||||
auto dir = dirOf(*path);
|
||||
abort();
|
||||
#if 0
|
||||
if (args[0]->type() == nPath) v.mkPath(dir); else v.mkString(dir, context);
|
||||
#endif
|
||||
state.forceValue(*args[0], pos);
|
||||
if (args[0]->type() == nPath) {
|
||||
auto path = args[0]->path();
|
||||
v.mkPath({path.accessor, dirOf(path.path)});
|
||||
} else {
|
||||
auto path = state.coerceToString(pos, *args[0], context, false, false);
|
||||
auto dir = dirOf(*path);
|
||||
v.mkString(dir, context);
|
||||
}
|
||||
}
|
||||
|
||||
static RegisterPrimOp primop_dirOf({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue