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:
parent
5f75d56c9b
commit
2287e2f279
8 changed files with 29 additions and 19 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue