Skip to content

Commit 6b38225

Browse files
authored
Merge pull request #1307 from tvainika/chakracore-cleanup
chore: Remove chakracore config leftovers
2 parents e74d28a + 553b5e3 commit 6b38225

File tree

1 file changed

+6
-22
lines changed

1 file changed

+6
-22
lines changed

functions.sh

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ function get_arch() {
4646
}
4747

4848
# Get corresponding variants based on the architecture.
49-
# All supported variants of each supported architecutre are listed in a
49+
# All supported variants of each supported architecture are listed in a
5050
# file - 'architectures'. Its format is:
51-
# <architecutre 1> <supported variant 1 >,<supported variant 2>...
52-
# <architecutre 2> <supported variant 1 >,<supported variant 2>...
51+
# <architecture 1> <supported variant 1 >,<supported variant 2>...
52+
# <architecture 2> <supported variant 1 >,<supported variant 2>...
5353
function get_variants() {
5454
local dir
5555
dir=${1:-.}
@@ -133,33 +133,17 @@ function get_config() {
133133

134134
# Get available versions for a given path
135135
#
136-
# If full or partial versions are provided then they are processed and
137-
# validated. e.g. "6 chakracore" returns "6 chakracore/8" since it processed the
138-
# chakracore entry and found it to be a fork rather than a complete version.
139-
#
140136
# The result is a list of valid versions.
141137
function get_versions() {
142-
local prefix
143-
prefix=${1:-.}
144-
shift
145-
146138
local versions=()
147-
local dirs=("$@")
139+
local dirs=()
148140

149141
local default_variant
150142
default_variant=$(get_config "./" "default_variant")
151-
if [ ${#dirs[@]} -eq 0 ]; then
152-
IFS=' ' read -ra dirs <<< "$(echo "${prefix%/}/"*/)"
153-
fi
143+
IFS=' ' read -ra dirs <<< "$(echo "./"*/)"
154144

155145
for dir in "${dirs[@]}"; do
156-
if [ -a "${dir}/config" ]; then
157-
local subdirs
158-
IFS=' ' read -ra subdirs <<< "$(get_versions "${dir#./}")"
159-
for subdir in "${subdirs[@]}"; do
160-
versions+=("${subdir}")
161-
done
162-
elif [ -a "${dir}/Dockerfile" ] || [ -a "${dir}/${default_variant}/Dockerfile" ]; then
146+
if [ -a "${dir}/Dockerfile" ] || [ -a "${dir}/${default_variant}/Dockerfile" ]; then
163147
versions+=("${dir#./}")
164148
fi
165149
done

0 commit comments

Comments
 (0)