mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-14 02:06:16 +02:00
Fix resolveExprPath()
This commit is contained in:
parent
53869fbd42
commit
e89d3e0edf
3 changed files with 10 additions and 5 deletions
|
@ -699,11 +699,8 @@ SourcePath resolveExprPath(const SourcePath & path)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// FIXME
|
// FIXME
|
||||||
auto path2 = path.path + "/default.nix";
|
auto path2 = path.append("/default.nix");
|
||||||
if (path.pathExists())
|
return path2.pathExists() ? path2 : path;
|
||||||
return {path.accessor, path2};
|
|
||||||
|
|
||||||
return path;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -227,6 +227,12 @@ std::ostream & operator << (std::ostream & str, const SourcePath & path)
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SourcePath SourcePath::append(std::string_view s) const
|
||||||
|
{
|
||||||
|
// FIXME: canonicalize?
|
||||||
|
return {accessor, path + s};
|
||||||
|
}
|
||||||
|
|
||||||
struct MemoryInputAccessorImpl : MemoryInputAccessor
|
struct MemoryInputAccessorImpl : MemoryInputAccessor
|
||||||
{
|
{
|
||||||
std::map<Path, std::string> files;
|
std::map<Path, std::string> files;
|
||||||
|
|
|
@ -92,6 +92,8 @@ struct SourcePath
|
||||||
{ return accessor.dumpPath(path, sink, filter); }
|
{ return accessor.dumpPath(path, sink, filter); }
|
||||||
|
|
||||||
std::string to_string() const;
|
std::string to_string() const;
|
||||||
|
|
||||||
|
SourcePath append(std::string_view s) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
std::ostream & operator << (std::ostream & str, const SourcePath & path);
|
std::ostream & operator << (std::ostream & str, const SourcePath & path);
|
||||||
|
|
Loading…
Reference in a new issue