mirror of
https://github.com/NixOS/nix
synced 2025-07-09 07:53:55 +02:00
Fix and extend nix-shell baseDir test
This commit is contained in:
parent
d5854f33e2
commit
f5b59fbc64
6 changed files with 20 additions and 2 deletions
|
@ -183,6 +183,9 @@ static void main_nix_build(int argc, char * * argv)
|
|||
struct MyArgs : LegacyArgs, MixEvalArgs
|
||||
{
|
||||
using LegacyArgs::LegacyArgs;
|
||||
void setBaseDir(Path baseDir) {
|
||||
commandBaseDir = baseDir;
|
||||
}
|
||||
};
|
||||
|
||||
MyArgs myArgs(myName, [&](Strings::iterator & arg, const Strings::iterator & end) {
|
||||
|
@ -290,6 +293,9 @@ static void main_nix_build(int argc, char * * argv)
|
|||
state->repair = myArgs.repair;
|
||||
if (myArgs.repair) buildMode = bmRepair;
|
||||
|
||||
if (inShebang) {
|
||||
myArgs.setBaseDir(absPath(dirOf(script)));
|
||||
}
|
||||
auto autoArgs = myArgs.getAutoArgs(*state);
|
||||
|
||||
auto autoArgsWithInNixShell = autoArgs;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue