Skip to content

Commit

Permalink
Automate "latest" and "3" aliases
Browse files Browse the repository at this point in the history
  • Loading branch information
tianon committed Dec 22, 2023
1 parent 2b3b80b commit 088718f
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions generate-stackbrew-library.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
#!/usr/bin/env bash
set -Eeuo pipefail

declare -A aliases=(
[3.2]='3 latest'
)

self="$(basename "$BASH_SOURCE")"
cd "$(dirname "$(readlink -f "$BASH_SOURCE")")"

Expand Down Expand Up @@ -73,6 +69,11 @@ join() {
echo "${out#$sep}"
}

declare -A latest=(
#[3]='3.2'
#[latest]='3.2'
)

for version; do
export version

Expand All @@ -86,9 +87,17 @@ for version; do
versionAliases=(
$fullVersion
$version
${aliases[$version]:-}
)

if [ "$version" = "${version%-rc}" ]; then
for a in "${version%%.*}" latest; do # "3", "latest"
if [ -z "${latest[$a]:-}" ]; then
latest[$a]="$version"
versionAliases+=( "$a" )
fi
done
fi

defaultDebianVariant="$(jq -r '
.[env.version].variants
| map(select(
Expand Down

0 comments on commit 088718f

Please sign in to comment.