From c23501a3b24d84376086179756fefd399c2a7cbb Mon Sep 17 00:00:00 2001 From: "lincoln auster [they/them]" Date: Sun, 6 Feb 2022 16:28:21 -0700 Subject: [PATCH] repl/load-flake: throw error if path isn't specified --- src/nix/repl.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/nix/repl.cc b/src/nix/repl.cc index e9bebff17..97ca39145 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);