Repl: error out if :log is called without a derivation
The repl crashes with an assertion error at lix/libutil/file-system.cc:45 if you run ':log' without any derivation, so I added a check to error out gracefully Change-Id: I7af70040f884e905f0514ea9883b2380fe148f15
This commit is contained in:
@@ -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()) {
|
||||
|
||||
Reference in New Issue
Block a user