Skip to content

Commit d2d0efe

Browse files
committed
Shellcheck: SC2046 and SC2086 quoting
1 parent 359ba16 commit d2d0efe

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

generate-stackbrew-library.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ array_6_11='6 boron';
1111
# shellcheck disable=SC2034
1212
array_8_1='8 latest';
1313

14-
cd $(cd ${0%/*} && pwd -P);
14+
cd "$(cd "${0%/*}" && pwd -P)";
1515

1616
self="$(basename "$BASH_SOURCE")"
1717

@@ -44,7 +44,7 @@ for version in "${versions[@]}"; do
4444
# Skip "docs" and other non-docker directories
4545
[ -f "$version/Dockerfile" ] || continue
4646

47-
eval stub=$(echo "$version" | awk -F. '{ print "$array_" $1 "_" $2 }');
47+
eval stub="$(echo "$version" | awk -F. '{ print "$array_" $1 "_" $2 }')";
4848
commit="$(fileCommit "$version")"
4949
fullVersion="$(grep -m1 'ENV NODE_VERSION ' "$version/Dockerfile" | cut -d' ' -f3)"
5050

@@ -55,7 +55,7 @@ for version in "${versions[@]}"; do
5555
echo "Directory: ${version}"
5656
echo
5757

58-
variants=$(echo $version/*/ | xargs -n1 basename)
58+
variants=$(echo "$version"/*/ | xargs -n1 basename)
5959
for variant in $variants; do
6060
# Skip non-docker directories
6161
[ -f "$version/$variant/Dockerfile" ] || continue

test-build.sh

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ fatal() {
1616
exit 1
1717
}
1818

19-
cd $(cd ${0%/*} && pwd -P);
19+
cd "$(cd "${0%/*}" && pwd -P)";
2020

2121
versions=( "$@" )
2222
if [ ${#versions[@]} -eq 0 ]; then
@@ -28,38 +28,38 @@ for version in "${versions[@]}"; do
2828
# Skip "docs" and other non-docker directories
2929
[ -f "$version/Dockerfile" ] || continue
3030

31-
tag=$(cat $version/Dockerfile | grep "ENV NODE_VERSION" | cut -d' ' -f3)
31+
tag=$(cat "$version/Dockerfile" | grep "ENV NODE_VERSION" | cut -d' ' -f3)
3232

3333
info "Building $tag..."
3434

35-
if ! docker build -t node:$tag $version; then
35+
if ! docker build -t node:"$tag" "$version"; then
3636
fatal "Build of $tag failed!"
3737
else
3838
info "Build of $tag succeeded."
3939
fi
4040

41-
OUTPUT=$(docker run --rm -it node:$tag node -e "process.stdout.write(process.versions.node)")
41+
OUTPUT=$(docker run --rm -it node:"$tag" node -e "process.stdout.write(process.versions.node)")
4242
if [ "$OUTPUT" != "$tag" ]; then
4343
fatal "Test of $tag failed!"
4444
else
4545
info "Test of $tag succeeded."
4646
fi
4747

48-
variants=$(echo $version/*/ | xargs -n1 basename)
48+
variants=$(echo "$version"/*/ | xargs -n1 basename)
4949

5050
for variant in $variants; do
5151
# Skip non-docker directories
5252
[ -f "$version/$variant/Dockerfile" ] || continue
53-
53+
5454
info "Building $tag-$variant variant..."
5555

56-
if ! docker build -t node:$tag-$variant $version/$variant; then
56+
if ! docker build -t node:"$tag-$variant" "$version/$variant"; then
5757
fatal "Build of $tag-$variant failed!"
5858
else
5959
info "Build of $tag-$variant succeeded."
6060
fi
6161

62-
OUTPUT=$(docker run --rm -it node:$tag-$variant node -e "process.stdout.write(process.versions.node)")
62+
OUTPUT=$(docker run --rm -it node:"$tag-$variant" node -e "process.stdout.write(process.versions.node)")
6363
if [ "$OUTPUT" != "$tag" ]; then
6464
fatal "Test of $tag-$variant failed!"
6565
else

update.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22
set -e
33

4-
cd $(cd ${0%/*} && pwd -P);
4+
cd "$(cd "${0%/*}" && pwd -P)";
55

66
versions=( "$@" )
77
if [ ${#versions[@]} -eq 0 ]; then
@@ -39,7 +39,7 @@ for version in "${versions[@]}"; do
3939

4040
update_node_version
4141

42-
variants=$(echo $version/*/ | xargs -n1 basename)
42+
variants=$(echo "$version"/*/ | xargs -n1 basename)
4343

4444
for variant in $variants; do
4545
# Skip non-docker directories

0 commit comments

Comments
 (0)