Skip to content

Commit 41d0d0d

Browse files
Merge pull request #2156 from nodejs/fix-update-script
2 parents 59baa0a + df44813 commit 41d0d0d

File tree

3 files changed

+14
-9
lines changed

3 files changed

+14
-9
lines changed

build-automation.mjs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,13 @@ export default async function(github) {
8787
} else {
8888
const newVersions = await checkForMuslVersionsAndSecurityReleases(github, versions);
8989
let updatedVersions = [];
90-
for (let version of Object.keys(newVersions)) {
91-
if (newVersions[version].muslBuildExists) {
92-
const { stdout } = await exec(`./update.sh ${newVersions[version].isSecurityRelease ? "-s " : ""}${version}`);
90+
for (const [version, newVersion] of Object.entries(newVersions)) {
91+
if (newVersion.muslBuildExists) {
92+
const { stdout } = await exec(`./update.sh ${newVersion.isSecurityRelease ? "-s " : ""}${version}`);
9393
console.log(stdout);
94-
updatedVersions.push(newVersions[version].fullVersion);
94+
updatedVersions.push(newVersion.fullVersion);
9595
} else {
96-
console.log(`There's no musl build for version ${newVersions[version].fullVersion} yet.`);
96+
console.log(`There's no musl build for version ${newVersion.fullVersion} yet.`);
9797
process.exit(0);
9898
}
9999
}

functions.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,13 +136,18 @@ function get_config() {
136136
# Get available versions for a given path
137137
#
138138
# The result is a list of valid versions.
139+
# shellcheck disable=SC2120
139140
function get_versions() {
141+
shift
142+
140143
local versions=()
141-
local dirs=()
144+
local dirs=("$@")
142145

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

147152
for dir in "${dirs[@]}"; do
148153
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)