diff options
-rw-r--r-- | check/bash.sh | 14 | ||||
-rw-r--r-- | check/ksh.sh | 11 | ||||
-rw-r--r-- | check/sh.sh | 19 | ||||
-rw-r--r-- | lint/bash.sh | 10 | ||||
-rw-r--r-- | lint/ksh.sh | 9 | ||||
-rw-r--r-- | lint/sh.sh | 14 |
6 files changed, 49 insertions, 28 deletions
diff --git a/check/bash.sh b/check/bash.sh index a3efccb1..1f9e1b38 100644 --- a/check/bash.sh +++ b/check/bash.sh @@ -1,5 +1,11 @@ -for bash in bash/* bash/bashrc.d/* ; do - [ -f "$bash" ] || continue - bash -n "$bash" || exit +set \ + bash/bash_completion \ + bash/bash_completion.d/*.bash \ + bash/bash_logout \ + bash/bash_profile \ + bash/bashrc \ + bash/bashrc.d/*.bash +for bash ; do + bash -n -- "$bash" || exit done -printf 'All bash(1) scripts parsed successfully.\n' +printf 'GNU Bash dotfiles parsed successfully.\n' diff --git a/check/ksh.sh b/check/ksh.sh index 51e71e19..f4bade82 100644 --- a/check/ksh.sh +++ b/check/ksh.sh @@ -1,5 +1,8 @@ -for ksh in ksh/* ksh/kshrc.d/* ; do - [ -f "$ksh" ] || continue - ksh -n "$ksh" || exit +set \ + ksh/kshrc \ + ksh/kshrc.d/*.ksh +for ksh ; do + ksh -n -- "$ksh" || exit done -printf 'All ksh scripts parsed successfully.\n' +sh -n -- ksh/shrc.d/ksh.sh || exit +printf 'Korn shell dotfiles parsed successfully.\n' diff --git a/check/sh.sh b/check/sh.sh index c5a86955..92910c11 100644 --- a/check/sh.sh +++ b/check/sh.sh @@ -1,11 +1,10 @@ -for sh in \ - sh/* sh/profile.d/* sh/shrc.d/* \ - keychain/profile.d/* keychain/shrc.d/* \ - ksh/shrc.d/* \ - mpd/profile.d/* \ - plenv/profile.d/* plenv/shrc.d/* \ -; do - [ -f "$sh" ] || continue - sh -n "$sh" || exit +set \ + sh/profile \ + sh/profile.d/*.sh \ + sh/shinit \ + sh/shrc \ + sh/shrc.d/*.sh +for sh ; do + sh -n -- "$sh" || exit done -printf 'All sh(1) scripts parsed successfully.\n' +printf 'POSIX shell dotfiles parsed successfully.\n' diff --git a/lint/bash.sh b/lint/bash.sh index 2fe1ba13..6457da35 100644 --- a/lint/bash.sh +++ b/lint/bash.sh @@ -1 +1,9 @@ -find bash -type f -print -exec shellcheck -e SC1090 -s bash -- {} + +set \ + bash/bash_completion \ + bash/bash_completion.d/*.bash \ + bash/bash_logout \ + bash/bash_profile \ + bash/bashrc \ + bash/bashrc.d/*.bash +shellcheck -e SC1090 -s bash -- "$@" || exit +printf 'GNU Bash dotfiles linted successfully.\n' diff --git a/lint/ksh.sh b/lint/ksh.sh index 4cedc6f7..102e0e54 100644 --- a/lint/ksh.sh +++ b/lint/ksh.sh @@ -1,3 +1,6 @@ -find ksh \ - -type f -name '*.sh' -exec shellcheck -e SC1090 -s sh -- {} + -o \ - -type f -exec shellcheck -e SC1090 -s ksh -- {} + +set \ + ksh/kshrc \ + ksh/kshrc.d/*.ksh +shellcheck -e SC1090 -s ksh -- "$@" || exit +shellcheck -e SC1090 -s sh -- ksh/shrc.d/ksh.sh || exit +printf 'Korn shell dotfiles linted successfully.\n' @@ -1,6 +1,8 @@ -find sh \ - keychain/profile.d keychain/shrc.d \ - ksh/shrc.d \ - mpd/profile.d \ - plenv/profile.d plenv/shrc.d \ - -type f -print -exec shellcheck -e SC1090 -s sh -- {} + +set \ + sh/profile \ + sh/profile.d/*.sh \ + sh/shinit \ + sh/shrc \ + sh/shrc.d/*.sh +shellcheck -e SC1090 -s sh -- "$@" || exit +printf 'POSIX shell dotfiles linted successfully.\n' |