mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-10 00:08:07 +02:00
nix-build.cc: Refactor: extract baseDir variable
This commit is contained in:
parent
5c367ece89
commit
e9479b272f
1 changed files with 5 additions and 2 deletions
|
@ -310,14 +310,17 @@ static void main_nix_build(int argc, char * * argv)
|
|||
auto [path, outputNames] = parsePathWithOutputs(absolute);
|
||||
if (evalStore->isStorePath(path) && hasSuffix(path, ".drv"))
|
||||
drvs.push_back(PackageInfo(*state, evalStore, absolute));
|
||||
else
|
||||
else {
|
||||
/* If we're in a #! script, interpret filenames
|
||||
relative to the script. */
|
||||
auto baseDir = inShebang && !packages ? absPath(i, absPath(dirOf(script))) : i;
|
||||
|
||||
exprs.push_back(
|
||||
state->parseExprFromFile(
|
||||
resolveExprPath(
|
||||
lookupFileArg(*state,
|
||||
inShebang && !packages ? absPath(i, absPath(dirOf(script))) : i))));
|
||||
baseDir))));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue