Skip to content

Commit 3aed962

Browse files
committed
Improve generate-stackbrew-library.sh
1 parent 05aef2f commit 3aed962

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

generate-stackbrew-library.sh

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,9 @@ join() {
6666

6767
for version in "${versions[@]}"; do
6868
commit="$(dirCommit "$version")"
69-
parent="$(awk 'toupper($1) == "FROM" { print $2 }' "$version/Dockerfile")"
70-
# no i386 for now: https://github.com/docker-library/gcc/issues/38
71-
arches="$(echo " ${parentRepoToArches[$parent]} " | sed -r -e 's/ i386//g')"
7269

7370
dockerfile="$(git show "$commit":"$version/Dockerfile")"
74-
fullVersion="$(echo "$dockerfile" | awk '$1 == "ENV" && $2 == "GCC_VERSION" { print $3; exit }')"
71+
fullVersion="$(awk '$1 == "ENV" && $2 == "GCC_VERSION" { print $3; exit }' <<<"$dockerfile")"
7572

7673
versionAliases=()
7774
while [ "$fullVersion" != "$version" -a "${fullVersion%[.-]*}" != "$fullVersion" ]; do
@@ -83,13 +80,17 @@ for version in "${versions[@]}"; do
8380
${aliases[$version]:-}
8481
)
8582

83+
parent="$(awk 'toupper($1) == "FROM" { print $2 }' <<<"$dockerfile")"
84+
# no i386 for now: https://github.com/docker-library/gcc/issues/38
85+
arches="$(echo " ${parentRepoToArches[$parent]} " | sed -r -e 's/ i386 / /g')"
86+
8687
echo
87-
echo "$dockerfile" | grep -m1 '^# Last Modified: '
88+
grep -m1 '^# Last Modified: ' <<<"$dockerfile"
8889
cat <<-EOE
8990
Tags: $(join ', ' "${versionAliases[@]}")
9091
Architectures: $(join ', ' $arches)
9192
GitCommit: $commit
9293
Directory: $version
9394
EOE
94-
echo "$dockerfile" | grep -m1 '^# Docker EOL: '
95+
grep -m1 '^# Docker EOL: ' <<<"$dockerfile"
9596
done

0 commit comments

Comments
 (0)