Shellcheck: SC2046 and SC2086 quoting

This commit is contained in:
Nick Schonning 2017-06-14 02:38:15 -04:00
parent 359ba16fe0
commit d2d0efe69c
3 changed files with 13 additions and 13 deletions

View File

@ -11,7 +11,7 @@ array_6_11='6 boron';
# shellcheck disable=SC2034 # shellcheck disable=SC2034
array_8_1='8 latest'; array_8_1='8 latest';
cd $(cd ${0%/*} && pwd -P); cd "$(cd "${0%/*}" && pwd -P)";
self="$(basename "$BASH_SOURCE")" self="$(basename "$BASH_SOURCE")"
@ -44,7 +44,7 @@ for version in "${versions[@]}"; do
# Skip "docs" and other non-docker directories # Skip "docs" and other non-docker directories
[ -f "$version/Dockerfile" ] || continue [ -f "$version/Dockerfile" ] || continue
eval stub=$(echo "$version" | awk -F. '{ print "$array_" $1 "_" $2 }'); eval stub="$(echo "$version" | awk -F. '{ print "$array_" $1 "_" $2 }')";
commit="$(fileCommit "$version")" commit="$(fileCommit "$version")"
fullVersion="$(grep -m1 'ENV NODE_VERSION ' "$version/Dockerfile" | cut -d' ' -f3)" fullVersion="$(grep -m1 'ENV NODE_VERSION ' "$version/Dockerfile" | cut -d' ' -f3)"
@ -55,7 +55,7 @@ for version in "${versions[@]}"; do
echo "Directory: ${version}" echo "Directory: ${version}"
echo echo
variants=$(echo $version/*/ | xargs -n1 basename) variants=$(echo "$version"/*/ | xargs -n1 basename)
for variant in $variants; do for variant in $variants; do
# Skip non-docker directories # Skip non-docker directories
[ -f "$version/$variant/Dockerfile" ] || continue [ -f "$version/$variant/Dockerfile" ] || continue

View File

@ -16,7 +16,7 @@ fatal() {
exit 1 exit 1
} }
cd $(cd ${0%/*} && pwd -P); cd "$(cd "${0%/*}" && pwd -P)";
versions=( "$@" ) versions=( "$@" )
if [ ${#versions[@]} -eq 0 ]; then if [ ${#versions[@]} -eq 0 ]; then
@ -28,24 +28,24 @@ for version in "${versions[@]}"; do
# Skip "docs" and other non-docker directories # Skip "docs" and other non-docker directories
[ -f "$version/Dockerfile" ] || continue [ -f "$version/Dockerfile" ] || continue
tag=$(cat $version/Dockerfile | grep "ENV NODE_VERSION" | cut -d' ' -f3) tag=$(cat "$version/Dockerfile" | grep "ENV NODE_VERSION" | cut -d' ' -f3)
info "Building $tag..." info "Building $tag..."
if ! docker build -t node:$tag $version; then if ! docker build -t node:"$tag" "$version"; then
fatal "Build of $tag failed!" fatal "Build of $tag failed!"
else else
info "Build of $tag succeeded." info "Build of $tag succeeded."
fi fi
OUTPUT=$(docker run --rm -it node:$tag node -e "process.stdout.write(process.versions.node)") OUTPUT=$(docker run --rm -it node:"$tag" node -e "process.stdout.write(process.versions.node)")
if [ "$OUTPUT" != "$tag" ]; then if [ "$OUTPUT" != "$tag" ]; then
fatal "Test of $tag failed!" fatal "Test of $tag failed!"
else else
info "Test of $tag succeeded." info "Test of $tag succeeded."
fi fi
variants=$(echo $version/*/ | xargs -n1 basename) variants=$(echo "$version"/*/ | xargs -n1 basename)
for variant in $variants; do for variant in $variants; do
# Skip non-docker directories # Skip non-docker directories
@ -53,13 +53,13 @@ for version in "${versions[@]}"; do
info "Building $tag-$variant variant..." info "Building $tag-$variant variant..."
if ! docker build -t node:$tag-$variant $version/$variant; then if ! docker build -t node:"$tag-$variant" "$version/$variant"; then
fatal "Build of $tag-$variant failed!" fatal "Build of $tag-$variant failed!"
else else
info "Build of $tag-$variant succeeded." info "Build of $tag-$variant succeeded."
fi fi
OUTPUT=$(docker run --rm -it node:$tag-$variant node -e "process.stdout.write(process.versions.node)") OUTPUT=$(docker run --rm -it node:"$tag-$variant" node -e "process.stdout.write(process.versions.node)")
if [ "$OUTPUT" != "$tag" ]; then if [ "$OUTPUT" != "$tag" ]; then
fatal "Test of $tag-$variant failed!" fatal "Test of $tag-$variant failed!"
else else

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
set -e set -e
cd $(cd ${0%/*} && pwd -P); cd "$(cd "${0%/*}" && pwd -P)";
versions=( "$@" ) versions=( "$@" )
if [ ${#versions[@]} -eq 0 ]; then if [ ${#versions[@]} -eq 0 ]; then
@ -39,7 +39,7 @@ for version in "${versions[@]}"; do
update_node_version update_node_version
variants=$(echo $version/*/ | xargs -n1 basename) variants=$(echo "$version"/*/ | xargs -n1 basename)
for variant in $variants; do for variant in $variants; do
# Skip non-docker directories # Skip non-docker directories