Skip to content

Commit 2d3b74e

Browse files
committed
fix: correct update script to support version argument again
1 parent ebd48c9 commit 2d3b74e

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

functions.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,12 +137,16 @@ function get_config() {
137137
#
138138
# The result is a list of valid versions.
139139
function get_versions() {
140+
shift
141+
140142
local versions=()
141-
local dirs=()
143+
local dirs=("$@")
142144

143145
local default_variant
144146
default_variant=$(get_config "./" "default_variant")
145-
IFS=' ' read -ra dirs <<< "$(echo "./"*/)"
147+
if [ ${#dirs[@]} -eq 0 ]; then
148+
IFS=' ' read -ra dirs <<< "$(echo "./"*/)"
149+
fi
146150

147151
for dir in "${dirs[@]}"; do
148152
if [ -a "${dir}/Dockerfile" ] || [ -a "${dir}/${default_variant}/Dockerfile" ]; then

update.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,8 @@ function update_node_version() {
189189
)
190190
}
191191

192+
pids=()
193+
192194
for version in "${versions[@]}"; do
193195
parentpath=$(dirname "${version}")
194196
versionnum=$(basename "${version}")
@@ -201,8 +203,6 @@ for version in "${versions[@]}"; do
201203
# See details in function.sh
202204
IFS=' ' read -ra variants <<< "$(get_variants "${parentpath}")"
203205

204-
pids=()
205-
206206
if [ -f "${version}/Dockerfile" ]; then
207207
if [ "${update_version}" -eq 0 ]; then
208208
update_node_version "${baseuri}" "${versionnum}" "${parentpath}/Dockerfile.template" "${version}/Dockerfile" &

0 commit comments

Comments
 (0)