aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2016-08-02 17:03:37 +1200
committerTom Ryder <tom@sanctum.geek.nz>2016-08-02 17:03:37 +1200
commit64020bea700cd600d899a4e584419f98adcb9a4d (patch)
treec482b2df718826cf3b84cac8ca3ade7bb16b9855
parentSlightly nicer text syntax (diff)
downloaddotfiles-64020bea700cd600d899a4e584419f98adcb9a4d.tar.gz
dotfiles-64020bea700cd600d899a4e584419f98adcb9a4d.zip
Fix up exit values and glob checks
-rwxr-xr-xtest/bash5
-rwxr-xr-xtest/bin7
-rwxr-xr-xtest/games7
-rwxr-xr-xtest/sh5
-rwxr-xr-xtest/urxvt3
5 files changed, 14 insertions, 13 deletions
diff --git a/test/bash b/test/bash
index 6f52d522..60616c95 100755
--- a/test/bash
+++ b/test/bash
@@ -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'
diff --git a/test/bin b/test/bin
index 75c399de..499c6005 100755
--- a/test/bin
+++ b/test/bin
@@ -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
diff --git a/test/games b/test/games
index 931c3141..c1e3cf4a 100755
--- a/test/games
+++ b/test/games
@@ -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
diff --git a/test/sh b/test/sh
index 354a40c7..47e41c77 100755
--- a/test/sh
+++ b/test/sh
@@ -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'
diff --git a/test/urxvt b/test/urxvt
index 90a298d7..71970b8f 100755
--- a/test/urxvt
+++ b/test/urxvt
@@ -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'