aboutsummaryrefslogtreecommitdiff
path: root/utils.nix
diff options
context:
space:
mode:
Diffstat (limited to 'utils.nix')
-rw-r--r--utils.nix6
1 files 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
'';
});