mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-10 19:55:41 +03:00
lib/customisation: fix callPackage error messages
This commit is contained in:
parent
e2987b884f
commit
37445f3c5c
1 changed files with 3 additions and 2 deletions
|
@ -4,11 +4,12 @@ let
|
||||||
inherit (builtins)
|
inherit (builtins)
|
||||||
intersectAttrs;
|
intersectAttrs;
|
||||||
inherit (lib)
|
inherit (lib)
|
||||||
functionArgs isFunction mirrorFunctionArgs isAttrs setFunctionArgs levenshteinAtMost
|
functionArgs isFunction mirrorFunctionArgs isAttrs setFunctionArgs
|
||||||
optionalAttrs attrNames levenshtein filter elemAt concatStringsSep sort take length
|
optionalAttrs attrNames levenshtein filter elemAt concatStringsSep sort take length
|
||||||
filterAttrs optionalString flip pathIsDirectory head pipe isDerivation listToAttrs
|
filterAttrs optionalString flip pathIsDirectory head pipe isDerivation listToAttrs
|
||||||
mapAttrs seq flatten deepSeq warnIf isInOldestRelease extends
|
mapAttrs seq flatten deepSeq warnIf isInOldestRelease extends
|
||||||
;
|
;
|
||||||
|
inherit (lib.strings) levenshteinAtMost;
|
||||||
|
|
||||||
in
|
in
|
||||||
rec {
|
rec {
|
||||||
|
@ -198,7 +199,7 @@ rec {
|
||||||
+ "${loc'}${prettySuggestions (getSuggestions arg)}";
|
+ "${loc'}${prettySuggestions (getSuggestions arg)}";
|
||||||
|
|
||||||
# Only show the error for the first missing argument
|
# Only show the error for the first missing argument
|
||||||
error = errorForArg missingArgs.${head (attrNames missingArgs)};
|
error = errorForArg (head (attrNames missingArgs));
|
||||||
|
|
||||||
in if missingArgs == {}
|
in if missingArgs == {}
|
||||||
then makeOverridable f allArgs
|
then makeOverridable f allArgs
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue