diff options
Diffstat (limited to 'check')
-rw-r--r-- | check/bash.sh | 14 | ||||
-rw-r--r-- | check/bin.sh | 15 | ||||
-rw-r--r-- | check/games.sh | 5 | ||||
-rw-r--r-- | check/ksh.sh | 11 | ||||
-rw-r--r-- | check/sh.sh | 19 | ||||
-rw-r--r-- | check/urxvt.sh | 4 | ||||
-rw-r--r-- | check/xinit.sh | 9 | ||||
-rw-r--r-- | check/zsh.sh | 12 |
8 files changed, 58 insertions, 31 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/bin.sh b/check/bin.sh index 04b0da6b..08b12778 100644 --- a/check/bin.sh +++ b/check/bin.sh @@ -1,4 +1,15 @@ +# POSIX sh for bin in bin/*.sh ; do - sh -n "$bin" || exit + sh -n -- "${bin%.sh}" || exit done -printf 'All shell scripts in bin parsed successfully.\n' +printf 'POSIX sh binscripts parsed successfully.\n' + +# GNU Bash +if command -v bash >/dev/null 2>&1 ; then + for bin in bin/*.bash ; do + bash -n -- "${bin%.bash}" || exit + done + printf 'GNU Bash binscripts parsed successfully.\n' +else + printf 'bash(1) not found, skipping GNU Bash checks.\n' +fi diff --git a/check/games.sh b/check/games.sh index 79d53ed5..cb1bcc31 100644 --- a/check/games.sh +++ b/check/games.sh @@ -1,4 +1,5 @@ +# POSIX sh for game in games/*.sh ; do - sh -n "$game" || exit + sh -n -- "${game%.sh}" || exit done -printf 'All shell scripts in games parsed successfully.\n' +printf 'POSIX sh games 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/check/urxvt.sh b/check/urxvt.sh index ee39e6c9..4a9e7501 100644 --- a/check/urxvt.sh +++ b/check/urxvt.sh @@ -1,4 +1,4 @@ for perl in urxvt/ext/*.pl ; do - perl -c "$perl" || exit + perl -c "${perl%.pl}" || exit done -printf 'All Perl scripts in urxvt/ext parsed successfully.\n' +printf 'URxvt Perl extensions parsed successfully.\n' diff --git a/check/xinit.sh b/check/xinit.sh index f8116908..fa235c9d 100644 --- a/check/xinit.sh +++ b/check/xinit.sh @@ -1,4 +1,7 @@ -for xinit in X/xinitrc X/xinitrc.d/*.sh ; do - sh -n "$xinit" || exit +set \ + X/xinitrc \ + X/xinitrc.d/*.sh +for xinit ; do + sh -n -- "$xinit" || exit done -printf 'X/xinitrc and all shell scripts in X/xinitrc.d parsed successfully.\n' +printf 'Xinit startup scripts parsed successfully.\n' diff --git a/check/zsh.sh b/check/zsh.sh index 50335d56..ce209584 100644 --- a/check/zsh.sh +++ b/check/zsh.sh @@ -1,5 +1,9 @@ -for zsh in zsh/* zsh/zshrc.d/* ; do - [ -f "$zsh" ] || continue - zsh -n "$zsh" || exit +set \ + zsh/zprofile \ + zsh/zshrc.d/*.zsh \ + zsh/zshrc +for zsh ; do + zsh -n -- "$zsh" || exit done -printf 'All zsh(1) scripts parsed successfully.\n' +sh -n zsh/profile.d/zsh.sh || exit +printf 'Z shell dotfiles parsed successfully.\n' |