Skip to content

Commit 818c8f4

Browse files
committed
style: fix shfmt lint errors
1 parent 4a44c91 commit 818c8f4

File tree

4 files changed

+61
-61
lines changed

4 files changed

+61
-61
lines changed

functions.sh

+31-31
Original file line numberDiff line numberDiff line change
@@ -21,25 +21,25 @@ fatal() {
2121
function get_arch() {
2222
local arch
2323
case $(uname -m) in
24-
x86_64)
25-
arch="amd64"
26-
;;
27-
ppc64le)
28-
arch="ppc64le"
29-
;;
30-
s390x)
31-
arch="s390x"
32-
;;
33-
aarch64)
34-
arch="arm64"
35-
;;
36-
armv7l)
37-
arch="arm32v7"
38-
;;
39-
*)
40-
echo "$0 does not support architecture ${arch} ... aborting"
41-
exit 1
42-
;;
24+
x86_64)
25+
arch="amd64"
26+
;;
27+
ppc64le)
28+
arch="ppc64le"
29+
;;
30+
s390x)
31+
arch="s390x"
32+
;;
33+
aarch64)
34+
arch="arm64"
35+
;;
36+
armv7l)
37+
arch="arm32v7"
38+
;;
39+
*)
40+
echo "$0 does not support architecture ${arch} ... aborting"
41+
exit 1
42+
;;
4343
esac
4444

4545
echo "${arch}"
@@ -62,7 +62,7 @@ function get_variants() {
6262

6363
arch=$(get_arch)
6464
variantsfilter=("$@")
65-
IFS=' ' read -ra availablevariants <<< "$(grep "^${arch}" "${dir}/architectures" | sed -E 's/'"${arch}"'[[:space:]]*//' | sed -E 's/,/ /g')"
65+
IFS=' ' read -ra availablevariants <<<"$(grep "^${arch}" "${dir}/architectures" | sed -E 's/'"${arch}"'[[:space:]]*//' | sed -E 's/,/ /g')"
6666

6767
if [ ${#variantsfilter[@]} -gt 0 ]; then
6868
for variant1 in "${availablevariants[@]}"; do
@@ -100,16 +100,16 @@ function get_supported_arches() {
100100
shift
101101

102102
# Get default supported arches
103-
lines=$(grep "${variant}" "$(dirname "${version}")"/architectures 2> /dev/null | cut -d' ' -f1)
103+
lines=$(grep "${variant}" "$(dirname "${version}")"/architectures 2>/dev/null | cut -d' ' -f1)
104104

105105
# Get version specific supported architectures if there is specialized information
106106
if [ -a "${version}"/architectures ]; then
107-
lines=$(grep "${variant}" "${version}"/architectures 2> /dev/null | cut -d' ' -f1)
107+
lines=$(grep "${variant}" "${version}"/architectures 2>/dev/null | cut -d' ' -f1)
108108
fi
109109

110110
while IFS='' read -r line; do
111111
arches+=("${line}")
112-
done <<< "${lines}"
112+
done <<<"${lines}"
113113

114114
echo "${arches[@]}"
115115
}
@@ -140,7 +140,7 @@ function get_versions() {
140140

141141
local default_variant
142142
default_variant=$(get_config "./" "default_variant")
143-
IFS=' ' read -ra dirs <<< "$(echo "./"*/)"
143+
IFS=' ' read -ra dirs <<<"$(echo "./"*/)"
144144

145145
for dir in "${dirs[@]}"; do
146146
if [ -a "${dir}/Dockerfile" ] || [ -a "${dir}/${default_variant}/Dockerfile" ]; then
@@ -168,7 +168,7 @@ function is_debian() {
168168
variant=$1
169169
shift
170170

171-
IFS=' ' read -ra debianVersions <<< "$(get_config "./" "debian_versions")"
171+
IFS=' ' read -ra debianVersions <<<"$(get_config "./" "debian_versions")"
172172
for d in "${debianVersions[@]}"; do
173173
if [ "${d}" = "${variant}" ]; then
174174
return 0
@@ -182,7 +182,7 @@ function is_debian_slim() {
182182
variant=$1
183183
shift
184184

185-
IFS=' ' read -ra debianVersions <<< "$(get_config "./" "debian_versions")"
185+
IFS=' ' read -ra debianVersions <<<"$(get_config "./" "debian_versions")"
186186
for d in "${debianVersions[@]}"; do
187187
if [ "${d}-slim" = "${variant}" ]; then
188188
return 0
@@ -196,7 +196,7 @@ function get_fork_name() {
196196
version=$1
197197
shift
198198

199-
IFS='/' read -ra versionparts <<< "${version}"
199+
IFS='/' read -ra versionparts <<<"${version}"
200200
if [ ${#versionparts[@]} -gt 1 ]; then
201201
echo "${versionparts[0]}"
202202
fi
@@ -282,7 +282,7 @@ function get_tag() {
282282
fi
283283

284284
local tagparts
285-
IFS=' ' read -ra tagparts <<< "$(get_fork_name "${version}") ${tagversion}"
285+
IFS=' ' read -ra tagparts <<<"$(get_fork_name "${version}") ${tagversion}"
286286
IFS='-'
287287
echo "${tagparts[*]}"
288288
unset IFS
@@ -300,11 +300,11 @@ function sort_versions() {
300300

301301
while IFS='' read -r line; do
302302
sorted+=("${line}")
303-
done <<< "$(echo "${lines}" | grep "^[0-9]" | sort -r)"
303+
done <<<"$(echo "${lines}" | grep "^[0-9]" | sort -r)"
304304

305305
while IFS='' read -r line; do
306306
sorted+=("${line}")
307-
done <<< "$(echo "${lines}" | grep -v "^[0-9]" | sort -r)"
307+
done <<<"$(echo "${lines}" | grep -v "^[0-9]" | sort -r)"
308308

309309
echo "${sorted[@]}"
310310
}
@@ -334,7 +334,7 @@ function images_updated() {
334334

335335
commit_range="$(commit_range "$@")"
336336

337-
IFS=' ' read -ra versions <<< "$(
337+
IFS=' ' read -ra versions <<<"$(
338338
IFS=','
339339
get_versions
340340
)"

generate-stackbrew-library.sh

+8-8
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
set -e
44
. functions.sh
55

6-
hash git 2> /dev/null || { echo >&2 "git not found, exiting."; }
6+
hash git 2>/dev/null || { echo >&2 "git not found, exiting."; }
77

88
# Used dynamically: print "$array_" $1
99
# shellcheck disable=SC2034
@@ -23,8 +23,8 @@ cd "$(cd "${0%/*}" && pwd -P)"
2323

2424
self="$(basename "${BASH_SOURCE[0]}")"
2525

26-
IFS=' ' read -ra versions <<< "$(get_versions)"
27-
IFS=' ' read -ra versions <<< "$(sort_versions "${versions[@]}")"
26+
IFS=' ' read -ra versions <<<"$(get_versions)"
27+
IFS=' ' read -ra versions <<<"$(sort_versions "${versions[@]}")"
2828
url='https://github.com/nodejs/docker-node'
2929

3030
# get the most recent commit which modified any of "$@"
@@ -50,7 +50,7 @@ join() {
5050
get_stub() {
5151
local version="${1}"
5252
shift
53-
IFS='/' read -ra versionparts <<< "${version}"
53+
IFS='/' read -ra versionparts <<<"${version}"
5454
local stub
5555
eval stub="$(join '_' "${versionparts[@]}" | awk -F. '{ print "$array_" $1 }')"
5656
echo "${stub}"
@@ -65,11 +65,11 @@ for version in "${versions[@]}"; do
6565
fullVersion="$(get_tag "${version}" full)"
6666
majorMinorVersion="$(get_tag "${version}" majorminor)"
6767

68-
IFS=' ' read -ra versionAliases <<< "$fullVersion $majorMinorVersion $stub"
68+
IFS=' ' read -ra versionAliases <<<"$fullVersion $majorMinorVersion $stub"
6969

7070
if [ -f "${version}/Dockerfile" ]; then
7171
# Get supported architectures for a specific version. See details in function.sh
72-
IFS=' ' read -ra supportedArches <<< "$(get_supported_arches "${version}" "default")"
72+
IFS=' ' read -ra supportedArches <<<"$(get_supported_arches "${version}" "default")"
7373

7474
echo "Tags: $(join ', ' "${versionAliases[@]}")"
7575
echo "Architectures: $(join ', ' "${supportedArches[@]}")"
@@ -80,7 +80,7 @@ for version in "${versions[@]}"; do
8080

8181
# Get supported variants according to the target architecture.
8282
# See details in function.sh
83-
IFS=' ' read -ra variants <<< "$(get_variants "$(dirname "${version}")")"
83+
IFS=' ' read -ra variants <<<"$(get_variants "$(dirname "${version}")")"
8484
for variant in "${variants[@]}"; do
8585
# Skip non-docker directories
8686
[ -f "${version}/${variant}/Dockerfile" ] || continue
@@ -100,7 +100,7 @@ for version in "${versions[@]}"; do
100100

101101
# Get supported architectures for a specific version and variant.
102102
# See details in function.sh
103-
IFS=' ' read -ra supportedArches <<< "$(get_supported_arches "${version}" "${variant}")"
103+
IFS=' ' read -ra supportedArches <<<"$(get_supported_arches "${version}" "${variant}")"
104104

105105
echo "Tags: $(join ', ' "${variantAliases[@]}")"
106106
echo "Architectures: $(join ', ' "${supportedArches[@]}")"

update-keys.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/bin/sh -ex
22

3-
curl -fsSLo- --compressed https://github.com/nodejs/node/raw/master/README.md | awk '/^gpg --keyserver pool.sks-keyservers.net --recv-keys/ {print $NF}' > keys/node.keys
3+
curl -fsSLo- --compressed https://github.com/nodejs/node/raw/master/README.md | awk '/^gpg --keyserver pool.sks-keyservers.net --recv-keys/ {print $NF}' >keys/node.keys

update.sh

+21-21
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
set -ue
44

55
function usage() {
6-
cat << EOF
6+
cat <<EOF
77
88
Update the node docker images.
99
@@ -30,31 +30,31 @@ EOF
3030
SKIP=false
3131
while getopts "sh" opt; do
3232
case "${opt}" in
33-
s)
34-
SKIP=true
35-
shift
36-
;;
37-
h)
38-
usage
39-
exit
40-
;;
41-
\?)
42-
usage
43-
exit
44-
;;
33+
s)
34+
SKIP=true
35+
shift
36+
;;
37+
h)
38+
usage
39+
exit
40+
;;
41+
\?)
42+
usage
43+
exit
44+
;;
4545
esac
4646
done
4747

4848
. functions.sh
4949

5050
cd "$(cd "${0%/*}" && pwd -P)"
5151

52-
IFS=',' read -ra versions_arg <<< "${1:-}"
53-
IFS=',' read -ra variant_arg <<< "${2:-}"
52+
IFS=',' read -ra versions_arg <<<"${1:-}"
53+
IFS=',' read -ra variant_arg <<<"${2:-}"
5454

55-
IFS=' ' read -ra versions <<< "$(get_versions .)"
56-
IFS=' ' read -ra update_versions <<< "$(get_versions . "${versions_arg[@]:-}")"
57-
IFS=' ' read -ra update_variants <<< "$(get_variants . "${variant_arg[@]:-}")"
55+
IFS=' ' read -ra versions <<<"$(get_versions .)"
56+
IFS=' ' read -ra update_versions <<<"$(get_versions . "${versions_arg[@]:-}")"
57+
IFS=' ' read -ra update_variants <<<"$(get_variants . "${variant_arg[@]:-}")"
5858
if [ ${#versions[@]} -eq 0 ]; then
5959
fatal "No valid versions found!"
6060
fi
@@ -150,7 +150,7 @@ function update_node_version() {
150150
while read -r line; do
151151
pattern='"\$\{'$(echo "${key_type}" | tr '[:lower:]' '[:upper:]')'_KEYS\[@\]\}"'
152152
sed -Ei -e "s/([ \\t]*)(${pattern})/\\1${line}${new_line}\\1\\2/" "${dockerfile}-tmp"
153-
done < "keys/${key_type}.keys"
153+
done <"keys/${key_type}.keys"
154154
sed -Ei -e "/${pattern}/d" "${dockerfile}-tmp"
155155
done
156156

@@ -181,7 +181,7 @@ function update_node_version() {
181181
rm "${dockerfile}-tmp-e"
182182
fi
183183

184-
if diff -q "${dockerfile}-tmp" "${dockerfile}" > /dev/null; then
184+
if diff -q "${dockerfile}-tmp" "${dockerfile}" >/dev/null; then
185185
echo "${dockerfile} is already up to date!"
186186
else
187187
echo "${dockerfile} updated!"
@@ -201,7 +201,7 @@ for version in "${versions[@]}"; do
201201

202202
# Get supported variants according the target architecture
203203
# See details in function.sh
204-
IFS=' ' read -ra variants <<< "$(get_variants "${parentpath}")"
204+
IFS=' ' read -ra variants <<<"$(get_variants "${parentpath}")"
205205

206206
if [ -f "${version}/Dockerfile" ]; then
207207
if [ "${update_version}" -eq 0 ]; then

0 commit comments

Comments
 (0)