1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-28 17:51:15 +02:00

Fixed minor things

This commit is contained in:
Nick Van den Broeck 2019-02-21 06:53:01 +01:00
parent d4ee8afd59
commit e007f367bd
5 changed files with 33 additions and 19 deletions

View file

@ -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");
}
}