Skip to content

Commit

Permalink
Allow to get official version defined in main branch, and not release…
Browse files Browse the repository at this point in the history
…d code

by downloading latest versions.json file
then if missing official version, try to use latest
  • Loading branch information
e-marchand committed Aug 29, 2023
1 parent 3890b00 commit a5887f1
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions download.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,13 @@ if [[ "$product_line" == "vcs" ]] || [[ "$version" == "vcs" ]]; then
fi
fi

#echo "version=$version"
#echo "product_line=$product_line"

if [[ "$build" == "official" ]]; then

curl -sL -f https://raw.githubusercontent.com/4d/tool4d-action/main/versions.json -o "$VERSION_FILE" 2>/dev/null || true

build=$(jq -r '.official."'$product_line'"."'$version'"|type=="object"' "$VERSION_FILE")
if [ "$build" == "true" ]; then
new_product_line=$(jq -r '.official."'$product_line'"."'$version'".product_line' "$VERSION_FILE")
Expand All @@ -54,6 +60,13 @@ if [[ "$build" == "official" ]]; then
>&2 echo "⚠️ No official build version found for product_line=$product_line version=$version build=$build. Use latest"
build="latest"
fi

if [ -n "$token" ]; then # take latest if possible
version="main"
product_line="main"
build=$(jq -r '.official.main.main' "$VERSION_FILE")
fi

fi

if [ "$product_line" == "null" ] || [ "$version" == "null" ] || [ "$build" == "null" ]; then
Expand Down

0 comments on commit a5887f1

Please sign in to comment.