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

nix: Parse --file relative to shebang script

This commit is contained in:
Robert Hensing 2023-05-12 19:56:04 +02:00 committed by tomberek
parent 198bc22e3b
commit 466271568b
3 changed files with 24 additions and 3 deletions

View file

@ -442,8 +442,9 @@ Installables SourceExprCommand::parseInstallables(
auto e = state->parseStdin();
state->eval(e, *vFile);
}
else if (file)
state->evalFile(lookupFileArg(*state, *file), *vFile);
else if (file) {
state->evalFile(lookupFileArg(*state, *file, CanonPath::fromCwd(getCommandBaseDir())), *vFile);
}
else {
CanonPath dir(CanonPath::fromCwd(getCommandBaseDir()));
auto e = state->parseExprFromString(*expr, state->rootPath(dir));