mirror of
https://github.com/NixOS/nix
synced 2025-07-09 07:53:55 +02:00
Add opt-out: nix-shell-shebang-arguments-relative-to-script
This commit is contained in:
parent
4c59d6e9f5
commit
63262e78c7
5 changed files with 22 additions and 3 deletions
|
@ -293,7 +293,7 @@ static void main_nix_build(int argc, char * * argv)
|
|||
state->repair = myArgs.repair;
|
||||
if (myArgs.repair) buildMode = bmRepair;
|
||||
|
||||
if (inShebang) {
|
||||
if (inShebang && compatibilitySettings.nixShellShebangArgumentsRelativeToScript) {
|
||||
myArgs.setBaseDir(absPath(dirOf(script)));
|
||||
}
|
||||
auto autoArgs = myArgs.getAutoArgs(*state);
|
||||
|
@ -345,7 +345,7 @@ static void main_nix_build(int argc, char * * argv)
|
|||
if (fromArgs)
|
||||
exprs.push_back(state->parseExprFromString(
|
||||
std::move(i),
|
||||
inShebang ? lookupFileArg(*state, baseDir) : state->rootPath(".")
|
||||
(inShebang && compatibilitySettings.nixShellShebangArgumentsRelativeToScript) ? lookupFileArg(*state, baseDir) : state->rootPath(".")
|
||||
));
|
||||
else {
|
||||
auto absolute = i;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue