radare2/sys/shellcheck.sh
pancake e6f2cd0b2a
Remove trailing spaces (#19460)
$ git grep ' $' | grep -v ^test/ | cut -d : -f 1 | sort -u > /tmp/trailing
$ for a in `cat /tmp/trailing` ; do sed -i -e 's/ *$//' $a ; done
2021-12-02 17:39:59 +01:00

21 lines
338 B
Bash
Executable File

#!/bin/sh
checkshellscript() {
filelist="$1"
checkfun="$2"
printf '%s\n' "$filelist" | while IFS= read -r file
do
$checkfun "$file"
done
}
if [ -f "$1" ]; then
SCRIPTS="$1"
else
SCRIPTS=$(git grep '^#!/bin/sh' | cut -d: -f1)
fi
checkshellscript "$SCRIPTS" "shellcheck --format=gcc"
checkshellscript "$SCRIPTS" checkbashisms