Merge "Repl: error out if :log is called without a derivation" into main

This commit is contained in:
Toast
2025-03-13 19:15:47 +00:00
committed by Gerrit Code Review
+2
View File
@@ -713,6 +713,8 @@ ProcessLineResult NixRepl::processLine(std::string line)
}
else if (command == ":log") {
if (arg.empty())
throw Error("cannot use ':log' without a specifying a derivation");
StorePath drvPath = ([&] {
auto maybeDrvPath = evaluator.store->maybeParseStorePath(arg);
if (maybeDrvPath && maybeDrvPath->isDerivation()) {