mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2025-02-12 13:17:18 +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);
|
auto [path, outputNames] = parsePathWithOutputs(absolute);
|
||||||
if (evalStore->isStorePath(path) && hasSuffix(path, ".drv"))
|
if (evalStore->isStorePath(path) && hasSuffix(path, ".drv"))
|
||||||
drvs.push_back(PackageInfo(*state, evalStore, absolute));
|
drvs.push_back(PackageInfo(*state, evalStore, absolute));
|
||||||
else
|
else {
|
||||||
/* If we're in a #! script, interpret filenames
|
/* If we're in a #! script, interpret filenames
|
||||||
relative to the script. */
|
relative to the script. */
|
||||||
|
auto baseDir = inShebang && !packages ? absPath(i, absPath(dirOf(script))) : i;
|
||||||
|
|
||||||
exprs.push_back(
|
exprs.push_back(
|
||||||
state->parseExprFromFile(
|
state->parseExprFromFile(
|
||||||
resolveExprPath(
|
resolveExprPath(
|
||||||
lookupFileArg(*state,
|
lookupFileArg(*state,
|
||||||
inShebang && !packages ? absPath(i, absPath(dirOf(script))) : i))));
|
baseDir))));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue