mirror of
https://github.com/NixOS/nix
synced 2025-07-19 23:09:37 +02:00
Merge pull request #12254 from DeterminateSystems/fix-relative-path-on-cli
Fix relative 'path:' flakerefs in the CLI
This commit is contained in:
commit
e02026adae
8 changed files with 22 additions and 14 deletions
|
@ -97,7 +97,7 @@ struct PathInputScheme : InputScheme
|
|||
std::optional<std::string> isRelative(const Input & input) const
|
||||
{
|
||||
auto path = getStrAttr(input.attrs, "path");
|
||||
if (hasPrefix(path, "/"))
|
||||
if (isAbsolute(path))
|
||||
return std::nullopt;
|
||||
else
|
||||
return path;
|
||||
|
|
|
@ -153,7 +153,7 @@ static std::shared_ptr<Registry> getGlobalRegistry(const Settings & settings, re
|
|||
return std::make_shared<Registry>(settings, Registry::Global); // empty registry
|
||||
}
|
||||
|
||||
if (!hasPrefix(path, "/")) {
|
||||
if (!isAbsolute(path)) {
|
||||
auto storePath = downloadFile(store, path, "flake-registry.json").storePath;
|
||||
if (auto store2 = store.dynamic_pointer_cast<LocalFSStore>())
|
||||
store2->addPermRoot(storePath, getCacheDir() + "/flake-registry.json");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue