Add shell script linting with shellcheck for better portability
This commit is contained in:
parent
ab60e702d2
commit
886a6bdbe0
15 changed files with 87 additions and 57 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue