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

Merge pull request #11058 from hercules-ci/more-nix-shell

Make `#!nix-shell` arguments and options relative to script
This commit is contained in:
Eelco Dolstra 2024-07-17 21:52:34 +02:00 committed by GitHub
commit 1e1a8e8ad1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 133 additions and 3 deletions

View file

@ -214,7 +214,7 @@ Bindings * MixEvalArgs::getAutoArgs(EvalState & state)
auto v = state.allocValue();
std::visit(overloaded {
[&](const AutoArgExpr & arg) {
state.mkThunk_(*v, state.parseExprFromString(arg.expr, state.rootPath(".")));
state.mkThunk_(*v, state.parseExprFromString(arg.expr, compatibilitySettings.nixShellShebangArgumentsRelativeToScript ? state.rootPath(absPath(getCommandBaseDir())) : state.rootPath(".")));
},
[&](const AutoArgString & arg) {
v->mkString(arg.s);