diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2016-08-02 17:03:37 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2016-08-02 17:03:37 +1200 |
commit | 64020bea700cd600d899a4e584419f98adcb9a4d (patch) | |
tree | c482b2df718826cf3b84cac8ca3ade7bb16b9855 /test | |
parent | Slightly nicer text syntax (diff) | |
download | dotfiles-64020bea700cd600d899a4e584419f98adcb9a4d.tar.gz dotfiles-64020bea700cd600d899a4e584419f98adcb9a4d.zip |
Fix up exit values and glob checks
Diffstat (limited to 'test')
-rwxr-xr-x | test/bash | 5 | ||||
-rwxr-xr-x | test/bin | 7 | ||||
-rwxr-xr-x | test/games | 7 | ||||
-rwxr-xr-x | test/sh | 5 | ||||
-rwxr-xr-x | test/urxvt | 3 |
5 files changed, 14 insertions, 13 deletions
@@ -1,7 +1,6 @@ #!/bin/sh for bash in bash/* bash/bashrc.d/* bash/bash_profile.d/* ; do - if [ -f "$bash" ] && ! bash -n "$bash" ; then - exit 1 - fi + [ -e "$bash" ] || continue + bash -n "$bash" || exit done printf 'All bash(1) scripts parsed successfully.\n' @@ -1,15 +1,16 @@ #!/bin/sh for bin in bin/* ; do + [ -e "$bin" ] || continue hb=$(sed 1q "$bin") || exit case $hb in *bash) - bash -n "$bin" || exit 1 + bash -n "$bin" || exit ;; *sh) - sh -n "$bin" || exit 1 + sh -n "$bin" || exit ;; *'sed -f') - sed -f "$bin" /dev/null >/dev/null || exit 1 + sed -f "$bin" /dev/null >/dev/null || exit ;; *'awk -f') # Not sure how to test these yet @@ -1,15 +1,16 @@ #!/bin/sh for game in games/* ; do + [ -e "$game" ] || continue hb=$(sed 1q "$game") || exit case $hb in *bash) - bash -n "$game" || exit 1 + bash -n "$game" || exit ;; *sh) - sh -n "$game" || exit 1 + sh -n "$game" || exit ;; *'sed -f') - sed -f "$game" /dev/null >/dev/null || exit 1 + sed -f "$game" /dev/null >/dev/null || exit ;; *'awk -f') # Not sure how to test these yet @@ -1,7 +1,6 @@ #!/bin/sh for sh in sh/* sh/profile.d/* ; do - if [ -f "$sh" ] && ! sh -n "$sh" ; then - exit 1 - fi + [ -f "$sh" ] || continue + sh -n "$sh" || exit done printf 'All sh(1) scripts parsed successfully.\n' @@ -1,5 +1,6 @@ #!/bin/sh for perl in urxvt/ext/* ; do - perl -c "$perl" >/dev/null || exit 1 + [ -e "$perl" ] || continue + perl -c "$perl" >/dev/null || exit done printf 'All Perl scripts in urxvt/ext parsed successfully.\n' |