aboutsummaryrefslogtreecommitdiff
path: root/src/nix
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2022-02-07 20:44:10 +0100
committerGitHub <noreply@github.com>2022-02-07 20:44:10 +0100
commit7c64a9dfd4a8e9e171ea8b5c1806ca079b2f19ca (patch)
treefff2011c28b9c09cb28182007034b3902d205205 /src/nix
parent725817c223847644025bc67160e2d25f5e4eb302 (diff)
parentb1abfcd0c247df7dc269ba8cb6b1e23d287c20ad (diff)
Merge pull request #6054 from lincolnauster/lf-reporterr
repl/load-flake: throw error if path isn't specified
Diffstat (limited to 'src/nix')
-rw-r--r--src/nix/repl.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/nix/repl.cc b/src/nix/repl.cc
index e9bebff17..2c39fac91 100644
--- a/src/nix/repl.cc
+++ b/src/nix/repl.cc
@@ -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);