diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2022-02-07 20:44:10 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-07 20:44:10 +0100 |
commit | 7c64a9dfd4a8e9e171ea8b5c1806ca079b2f19ca (patch) | |
tree | fff2011c28b9c09cb28182007034b3902d205205 /src/nix | |
parent | 725817c223847644025bc67160e2d25f5e4eb302 (diff) | |
parent | b1abfcd0c247df7dc269ba8cb6b1e23d287c20ad (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.cc | 3 |
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); |