mirror of
https://github.com/NixOS/nix
synced 2025-06-27 16:51:15 +02:00
Handle store symlinks in flake directories
E.g. 'nix path-info ./result' inside a flake directory now works again.
This commit is contained in:
parent
4f6a7c8621
commit
d132d057a8
5 changed files with 25 additions and 12 deletions
|
@ -143,6 +143,14 @@ FlakeRef::FlakeRef(const std::string & uri_, bool allowRelative)
|
|||
IsPath d;
|
||||
if (allowRelative) {
|
||||
d.path = absPath(uri);
|
||||
try {
|
||||
if (!S_ISDIR(lstat(d.path).st_mode))
|
||||
throw BadFlakeRef("path '%s' is not a flake (sub)directory");
|
||||
} catch (SysError & e) {
|
||||
if (e.errNo == ENOENT || e.errNo == EISDIR)
|
||||
throw BadFlakeRef("flake '%s' does not exist");
|
||||
throw;
|
||||
}
|
||||
while (true) {
|
||||
if (pathExists(d.path + "/.git")) break;
|
||||
subdir = baseNameOf(d.path) + (subdir.empty() ? "" : "/" + subdir);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue