mirror of
https://github.com/NixOS/nix
synced 2025-06-28 17:51:15 +02:00
Fixed minor things
This commit is contained in:
parent
d4ee8afd59
commit
e007f367bd
5 changed files with 33 additions and 19 deletions
|
@ -299,14 +299,14 @@ FlakeRegistry updateLockFile(EvalState & evalState, FlakeRef & flakeRef)
|
|||
void updateLockFile(EvalState & state, std::string path)
|
||||
{
|
||||
// 'path' is the path to the local flake repo.
|
||||
FlakeRef flakeRef = FlakeRef(path);
|
||||
FlakeRef flakeRef = FlakeRef("file://" + path);
|
||||
if (std::get_if<FlakeRef::IsGit>(&flakeRef.data)) {
|
||||
FlakeRegistry newLockFile = updateLockFile(state, flakeRef);
|
||||
writeRegistry(newLockFile, path + "/flake.lock");
|
||||
} else if (std::get_if<FlakeRef::IsGitHub>(&flakeRef.data)) {
|
||||
throw UsageError("You can only update local flakes, not flakes on GitHub.");
|
||||
throw UsageError("you can only update local flakes, not flakes on GitHub");
|
||||
} else {
|
||||
throw UsageError("You can only update local flakes, not flakes through their FlakeId.");
|
||||
throw UsageError("you can only update local flakes, not flakes through their FlakeId");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue