1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-28 17:51:15 +02:00

Fix nix shebang interaction with #8131 overhaul completions

This commit is contained in:
Robert Hensing 2023-10-23 18:38:54 +02:00 committed by tomberek
parent e91fd837ee
commit ffd414eb75
4 changed files with 25 additions and 29 deletions

View file

@ -294,7 +294,9 @@ void completeFlakeRefWithFragment(
prefixRoot = ".";
}
auto flakeRefS = std::string(prefix.substr(0, hash));
auto flakeRef = parseFlakeRef(expandTilde(flakeRefS), absPath(getCommandBaseDir()));
// TODO: ideally this would use the command base directory instead of assuming ".".
auto flakeRef = parseFlakeRef(expandTilde(flakeRefS), absPath("."));
auto evalCache = openEvalCache(*evalState,
std::make_shared<flake::LockedFlake>(lockFlake(*evalState, flakeRef, lockFlags)));