1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-12-16 14:01:05 +01:00

nix flake info: Show flake subdirectory

This commit is contained in:
Eelco Dolstra 2020-03-28 18:05:50 +01:00
parent 5f75d56c9b
commit 2287e2f279
8 changed files with 29 additions and 19 deletions

View file

@ -42,13 +42,16 @@ struct GitHubInput : Input
std::optional<Hash> getRev() const override { return rev; }
std::string to_string() const override
ParsedURL toURL() const override
{
auto s = fmt("github:%s/%s", owner, repo);
auto path = owner + "/" + repo;
assert(!(ref && rev));
if (ref) s += "/" + *ref;
if (rev) s += "/" + rev->to_string(Base16, false);
return s;
if (ref) path += "/" + *ref;
if (rev) path += "/" + rev->to_string(Base16, false);
return ParsedURL {
.scheme = "github",
.path = path,
};
}
Attrs toAttrsInternal() const override