mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-22 22:16:16 +02:00
repl/load-flake: throw error if path isn't specified
This commit is contained in:
parent
4369771870
commit
c23501a3b2
1 changed files with 3 additions and 0 deletions
|
@ -623,6 +623,9 @@ void NixRepl::loadFile(const Path & path)
|
|||
|
||||
void NixRepl::loadFlake(const std::string & flakeRefS)
|
||||
{
|
||||
if (flakeRefS.empty())
|
||||
throw Error("cannot use `:load-flake` without a path specified. (Use . for the current working directory.)");
|
||||
|
||||
auto flakeRef = parseFlakeRef(flakeRefS, absPath("."), true);
|
||||
if (evalSettings.pureEval && !flakeRef.input.isImmutable())
|
||||
throw Error("cannot use ':load-flake' on mutable flake reference '%s' (use --impure to override)", flakeRefS);
|
||||
|
|
Loading…
Reference in a new issue