1
0
Fork 0
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:
Robert Hensing 2024-07-07 00:22:21 +02:00
parent d5854f33e2
commit f5b59fbc64
6 changed files with 20 additions and 2 deletions

View file

@ -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;