aboutsummaryrefslogtreecommitdiff
path: root/utils.nix
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2019-06-01 09:12:44 -0300
committerEuAndreh <eu@euandre.org>2019-06-01 09:12:44 -0300
commitf68daad7db1897fc35ac4c17e5373c72b56db6c6 (patch)
tree9728c60ebe4b6e20bf3e611b5a54fe8e3db29ccb /utils.nix
parentTODOs.org (diff)
downloaddotfiles-f68daad7db1897fc35ac4c17e5373c72b56db6c6.tar.gz
dotfiles-f68daad7db1897fc35ac4c17e5373c72b56db6c6.tar.xz
Add fallback null value to the shelcheck derivation input
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
'';
});