Add shell script linting with shellcheck for better portability

This commit is contained in:
Damien Duportal 2019-05-10 17:24:06 +02:00 committed by Traefiker Bot
parent ab60e702d2
commit 886a6bdbe0
15 changed files with 87 additions and 57 deletions

View file

@ -11,20 +11,21 @@ DEFAULT_BUNDLES=(
test-integration
)
SCRIPT_DIR="$(cd "$(dirname "${0}")" && pwd -P)"
bundle() {
local bundle="$1"; shift
echo "---> Making bundle: $(basename "$bundle") (in $DEST)"
source "script/$bundle" "$@"
echo "---> Making bundle: $(basename "$bundle") (in $SCRIPT_DIR)"
# shellcheck source=/dev/null
source "${SCRIPT_DIR}/$bundle"
}
if [ $# -lt 1 ]; then
bundles=(${DEFAULT_BUNDLES[@]})
bundles=${DEFAULT_BUNDLES[*]}
else
bundles=($@)
bundles=${*}
fi
for bundle in ${bundles[@]}; do
export DEST=.
ABS_DEST="$(cd "$DEST" && pwd -P)"
for bundle in ${bundles[*]}; do
bundle "$bundle"
echo
done