Skip to content

Commit

Permalink
fix: correct update script to support version argument again
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB committed Oct 22, 2024
1 parent ebd48c9 commit 2d3b74e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 6 additions & 2 deletions functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,16 @@ function get_config() {
#
# The result is a list of valid versions.
function get_versions() {
shift

local versions=()
local dirs=()
local dirs=("$@")

local default_variant
default_variant=$(get_config "./" "default_variant")
IFS=' ' read -ra dirs <<< "$(echo "./"*/)"
if [ ${#dirs[@]} -eq 0 ]; then
IFS=' ' read -ra dirs <<< "$(echo "./"*/)"
fi

for dir in "${dirs[@]}"; do
if [ -a "${dir}/Dockerfile" ] || [ -a "${dir}/${default_variant}/Dockerfile" ]; then
Expand Down
4 changes: 2 additions & 2 deletions update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,8 @@ function update_node_version() {
)
}

pids=()

for version in "${versions[@]}"; do
parentpath=$(dirname "${version}")
versionnum=$(basename "${version}")
Expand All @@ -201,8 +203,6 @@ for version in "${versions[@]}"; do
# See details in function.sh
IFS=' ' read -ra variants <<< "$(get_variants "${parentpath}")"

pids=()

if [ -f "${version}/Dockerfile" ]; then
if [ "${update_version}" -eq 0 ]; then
update_node_version "${baseuri}" "${versionnum}" "${parentpath}/Dockerfile.template" "${version}/Dockerfile" &
Expand Down

0 comments on commit 2d3b74e

Please sign in to comment.