-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsmoke
executable file
·49 lines (46 loc) · 1.13 KB
/
smoke
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/zsh
#
# Written 2015-09-18 by Steven J. DeRose.
# Licensed under Creative Commons Attribution-Sharealike 3.0 unported license.
#
if isHelpOption "$1"; then
echo "$0 [dirToCheck]"
echo " Run all the executables in a directory, with just '-h'."
echo " This is a handy way to smoke out badly broken scripts."
echo " By default, checks the current dir."
echo ""
exit
elif [[ "$1" == "" ]]; then
B="$PWD"
D="CSV NET PERLLIBS PYTHONLIBS SHELL TEXT XML"
else
B=""
D="$1"
fi
echo
echo "Running everything under '$B'..."
echo
if ! [ -x colorstring ]; then
colorstring() {
shift; shift
echo "$*"
}
fi
colorstring -c 'blue/white' -m "******* STARTING DIR $B *******"
for x in `ls $B`; do
CMD="$B/$x"
if [[ "$CMD" == "$0" ]]; then
C=1
elif [[ "$CMD" =~ ".pyc" ]]; then
C=1
elif [[ -d "$CMD" ]]; then
C=1
elif ! [[ -x "$CMD" ]]; then
colorstring -c 'yellow' -m "'$CMD' IS NOT EXECUTABLE";
else
colorstring -c 'green' -m "$CMD";
$CMD -h 2>&1 >/dev/null | grep -v 'No documentation found'
fi
done
echo
echo "Done."