mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-24 14:56:15 +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
|
||||
|
||||
// FIXME
|
||||
auto path2 = path.path + "/default.nix";
|
||||
if (path.pathExists())
|
||||
return {path.accessor, path2};
|
||||
|
||||
return path;
|
||||
auto path2 = path.append("/default.nix");
|
||||
return path2.pathExists() ? path2 : path;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -227,6 +227,12 @@ std::ostream & operator << (std::ostream & str, const SourcePath & path)
|
|||
return str;
|
||||
}
|
||||
|
||||
SourcePath SourcePath::append(std::string_view s) const
|
||||
{
|
||||
// FIXME: canonicalize?
|
||||
return {accessor, path + s};
|
||||
}
|
||||
|
||||
struct MemoryInputAccessorImpl : MemoryInputAccessor
|
||||
{
|
||||
std::map<Path, std::string> files;
|
||||
|
|
|
@ -92,6 +92,8 @@ struct SourcePath
|
|||
{ return accessor.dumpPath(path, sink, filter); }
|
||||
|
||||
std::string to_string() const;
|
||||
|
||||
SourcePath append(std::string_view s) const;
|
||||
};
|
||||
|
||||
std::ostream & operator << (std::ostream & str, const SourcePath & path);
|
||||
|
|
Loading…
Reference in a new issue