Test all posix scripts
parent
60ea708429
commit
0f0a07c7fe
|
@ -3,28 +3,38 @@
|
||||||
set -o errexit
|
set -o errexit
|
||||||
set -o nounset
|
set -o nounset
|
||||||
|
|
||||||
PARAMS='-s -ln posix -i 0 -ci -kp'
|
. ./scripts/common
|
||||||
|
|
||||||
|
# -s Simplify the code
|
||||||
|
# -ln posix Language variant: POSIX
|
||||||
|
# -i 0 Use TAB to indent
|
||||||
|
# -ci Switch cases will be indented
|
||||||
|
# -kp Keep column alignment paddings
|
||||||
|
DPEI_PARAMS='-s -ln posix -i 0 -ci -kp'
|
||||||
|
|
||||||
case "${1:-}" in
|
case "${1:-}" in
|
||||||
check)
|
check)
|
||||||
PARAMS="$PARAMS -d"
|
DPEI_PARAMS="$DPEI_PARAMS -d"
|
||||||
;;
|
;;
|
||||||
fix)
|
fix)
|
||||||
PARAMS="$PARAMS -w"
|
DPEI_PARAMS="$DPEI_PARAMS -w"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
printf 'Syntax: %s <check|fix>' "$0" >&2
|
printf 'Syntax: %s <check|fix>\n' "$0" >&2
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
shfmt $PARAMS \
|
DPEI_FILES=install-php-extensions
|
||||||
install-php-extensions \
|
|
||||||
scripts/ci-filter-supported-extensions \
|
IFS='
|
||||||
scripts/ci-retrieve-recent-extensions \
|
'
|
||||||
scripts/ci-test-extensions \
|
for DPEI_FILE in $(find scripts -type f); do
|
||||||
scripts/common \
|
if test "$(head -n1 $DPEI_FILE)" = '#!/bin/sh'; then
|
||||||
scripts/invoke-shfmt \
|
DPEI_FILES="$DPEI_FILES $DPEI_FILE"
|
||||||
scripts/lint \
|
fi
|
||||||
scripts/test-restore-apt \
|
done
|
||||||
scripts/update-readme
|
|
||||||
|
resetIFS
|
||||||
|
|
||||||
|
FORCE_COLOR=true shfmt $DPEI_PARAMS -- $DPEI_FILES
|
||||||
|
|
Loading…
Reference in New Issue