nix-instantiate --eval: Apply auto-arguments if the result is a function
Fixes #254.
This commit is contained in:
parent
a55e77ae10
commit
95501c4dee
1 changed files with 10 additions and 5 deletions
|
@ -52,14 +52,19 @@ void processExpr(EvalState & state, const Strings & attrPaths,
|
||||||
state.forceValue(v);
|
state.forceValue(v);
|
||||||
|
|
||||||
PathSet context;
|
PathSet context;
|
||||||
if (evalOnly)
|
if (evalOnly) {
|
||||||
|
Value vRes;
|
||||||
|
if (autoArgs.empty())
|
||||||
|
vRes = v;
|
||||||
|
else
|
||||||
|
state.autoCallFunction(autoArgs, v, vRes);
|
||||||
if (xmlOutput)
|
if (xmlOutput)
|
||||||
printValueAsXML(state, strict, location, v, std::cout, context);
|
printValueAsXML(state, strict, location, vRes, std::cout, context);
|
||||||
else {
|
else {
|
||||||
if (strict) state.strictForceValue(v);
|
if (strict) state.strictForceValue(vRes);
|
||||||
std::cout << v << std::endl;
|
std::cout << vRes << std::endl;
|
||||||
}
|
}
|
||||||
else {
|
} else {
|
||||||
DrvInfos drvs;
|
DrvInfos drvs;
|
||||||
getDerivations(state, v, "", autoArgs, drvs, false);
|
getDerivations(state, v, "", autoArgs, drvs, false);
|
||||||
foreach (DrvInfos::iterator, i, drvs) {
|
foreach (DrvInfos::iterator, i, drvs) {
|
||||||
|
|
Loading…
Reference in a new issue