mirror of
https://github.com/NixOS/nix.git
synced 2025-11-19 16:59:35 +01:00
Merge pull request #8871 from teto/flake_show_attr
nix flake show: name attribute that must be a derivation
This commit is contained in:
commit
5462c5eedd
2 changed files with 27 additions and 2 deletions
|
|
@ -1324,8 +1324,10 @@ struct CmdFlakeShow : FlakeCommand, MixJSON
|
|||
try {
|
||||
if (visitor.isDerivation())
|
||||
showDerivation();
|
||||
else
|
||||
throw Error("expected a derivation");
|
||||
else {
|
||||
auto name = visitor.getAttrPathStr(state->s.name);
|
||||
logger->warn(fmt("%s is not a derivation", name));
|
||||
}
|
||||
} catch (IFDError & e) {
|
||||
if (!json) {
|
||||
logger->cout(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue