This ignores the following warning: warning: In POSIX sh, string replacement is undefined. [SC3060] As string replacements are supported by ash and we are only going to use ash. This allows us to use something short like ${QUERY_STRING//+/ } to replace all '+' to a whitespace in an URL or to make an ${IFNAME//-/_} UCI compatible in the future, for example. Instead of needing to use something long like "echo ${IFNAME} | tr '-' '_'. Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue>
29 lines
653 B
Bash
Executable File
29 lines
653 B
Bash
Executable File
#!/bin/sh
|
|
|
|
set -e
|
|
|
|
is_scriptfile() {
|
|
echo "$1" | grep -qE '.*\.sh$' || head -n1 "$1" | grep -qE '^#.*(sh|bash)$'
|
|
}
|
|
|
|
find contrib -type f | while read -r file; do
|
|
is_scriptfile "$file" || continue
|
|
|
|
echo "Checking $file"
|
|
shellcheck -f gcc "$file"
|
|
done
|
|
|
|
find package -type f | while read -r file; do
|
|
is_scriptfile "$file" || continue
|
|
|
|
echo "Checking $file"
|
|
shellcheck -f gcc -x -s sh -e SC2039,SC1091,SC2155,SC2034,SC3043,SC3037,SC3057,SC3060 "$file"
|
|
done
|
|
|
|
find scripts -type f | while read -r file; do
|
|
is_scriptfile "$file" || continue
|
|
|
|
echo "Checking $file"
|
|
shellcheck -f gcc -x -e SC2154,SC1090,SC2181,SC2155,SC2148,SC2034,SC2148 "$file"
|
|
done
|