From c23501a3b24d84376086179756fefd399c2a7cbb Mon Sep 17 00:00:00 2001 From: "lincoln auster [they/them]" Date: Sun, 6 Feb 2022 16:28:21 -0700 Subject: repl/load-flake: throw error if path isn't specified --- src/nix/repl.cc | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/nix') 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); -- cgit v1.2.3 From b1abfcd0c247df7dc269ba8cb6b1e23d287c20ad Mon Sep 17 00:00:00 2001 From: lincoln auster Date: Mon, 7 Feb 2022 08:35:50 -0700 Subject: fix markup Co-authored-by: Eelco Dolstra --- src/nix/repl.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nix') 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()) -- cgit v1.2.3