mirror of
https://github.com/NixOS/nix.git
synced 2025-11-30 06:01:00 +01:00
Fix findFile(), coerceToPath()
This commit is contained in:
parent
e7f8aa8bdd
commit
b4c6adfd35
13 changed files with 92 additions and 80 deletions
|
|
@ -167,9 +167,8 @@ static int main_nix_instantiate(int argc, char * * argv)
|
|||
|
||||
if (findFile) {
|
||||
for (auto & i : files) {
|
||||
Path p = state->findFile(i);
|
||||
if (p == "") throw Error("unable to find '%1%'", i);
|
||||
std::cout << p << std::endl;
|
||||
auto p = state->findFile(i);
|
||||
std::cout << p.readFile() << std::endl;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -184,7 +183,7 @@ static int main_nix_instantiate(int argc, char * * argv)
|
|||
for (auto & i : files) {
|
||||
Expr * e = fromArgs
|
||||
? state->parseExprFromString(i, absPath("."))
|
||||
: state->parseExprFromFile(resolveExprPath(state->rootPath(lookupFileArg(*state, i))));
|
||||
: state->parseExprFromFile(resolveExprPath(lookupFileArg(*state, i)));
|
||||
processExpr(*state, attrPaths, parseOnly, strict, autoArgs,
|
||||
evalOnly, outputKind, xmlOutputSourceLocation, e);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue