Skip to content

Commit

Permalink
Merge pull request nodejs#1307 from tvainika/chakracore-cleanup
Browse files Browse the repository at this point in the history
chore: Remove chakracore config leftovers
  • Loading branch information
nschonni authored Aug 4, 2020
2 parents e74d28a + 553b5e3 commit 6b38225
Showing 1 changed file with 6 additions and 22 deletions.
28 changes: 6 additions & 22 deletions functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ function get_arch() {
}

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

# Get available versions for a given path
#
# If full or partial versions are provided then they are processed and
# validated. e.g. "6 chakracore" returns "6 chakracore/8" since it processed the
# chakracore entry and found it to be a fork rather than a complete version.
#
# The result is a list of valid versions.
function get_versions() {
local prefix
prefix=${1:-.}
shift

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

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

for dir in "${dirs[@]}"; do
if [ -a "${dir}/config" ]; then
local subdirs
IFS=' ' read -ra subdirs <<< "$(get_versions "${dir#./}")"
for subdir in "${subdirs[@]}"; do
versions+=("${subdir}")
done
elif [ -a "${dir}/Dockerfile" ] || [ -a "${dir}/${default_variant}/Dockerfile" ]; then
if [ -a "${dir}/Dockerfile" ] || [ -a "${dir}/${default_variant}/Dockerfile" ]; then
versions+=("${dir#./}")
fi
done
Expand Down

0 comments on commit 6b38225

Please sign in to comment.