1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-28 09:31:16 +02:00

Merge remote-tracking branch 'matthewbauer/nix-shell-relative-shebang' into more-nix-shell

This commit is contained in:
Robert Hensing 2024-07-07 00:18:03 +02:00
commit 8838f5c746
3 changed files with 24 additions and 1 deletions

View file

@ -334,8 +334,13 @@ static void main_nix_build(int argc, char * * argv)
exprs = {state->parseStdin()};
else
for (auto i : remainingArgs) {
auto baseDir = inShebang && !packages ? absPath(dirOf(script)) : i;
if (fromArgs)
exprs.push_back(state->parseExprFromString(std::move(i), state->rootPath(".")));
exprs.push_back(state->parseExprFromString(
std::move(i),
inShebang ? lookupFileArg(*state, baseDir) : state->rootPath(".")
));
else {
auto absolute = i;
try {