From f68daad7db1897fc35ac4c17e5373c72b56db6c6 Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Sat, 1 Jun 2019 09:12:44 -0300 Subject: Add fallback null value to the shelcheck derivation input --- utils.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/utils.nix b/utils.nix index 8c63cc9..fd25021 100644 --- a/utils.nix +++ b/utils.nix @@ -14,11 +14,13 @@ in rec { ''; }; shellcheck = ignoredFindPattern: - baseTask.overrideAttrs (baseAttrs: { + baseTask.overrideAttrs (baseAttrs: rec { name = "${baseAttrs.name}-shellcheck"; buildInputs = baseAttrs.buildInputs ++ [ pkgs.shellcheck ]; + ignoredPattern = + if ignoredFindPattern == null then "" else ignoredFindPattern; buildPhase = '' - find . -type f \( -name '*.sh' -and -regextype egrep ! -regex '${ignoredFindPattern}' \) -print0 | xargs -0 shellcheck + find . -type f \( -name '*.sh' -and -regextype egrep ! -regex '${ignoredPattern}' \) -print0 | xargs -0 shellcheck touch $out ''; }); -- cgit v1.2.3