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 1/2] 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); From b1abfcd0c247df7dc269ba8cb6b1e23d287c20ad Mon Sep 17 00:00:00 2001 From: lincoln auster Date: Mon, 7 Feb 2022 08:35:50 -0700 Subject: [PATCH 2/2] fix markup Co-authored-by: Eelco Dolstra --- src/nix/repl.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nix/repl.cc b/src/nix/repl.cc index 97ca39145..2c39fac91 100644 --- a/src/nix/repl.cc +++ b/src/nix/repl.cc @@ -624,7 +624,7 @@ 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.)"); + 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())