fix: tranform version so update works [skip ci]

This commit is contained in:
Baptiste Augrain
2025-04-04 00:37:22 +02:00
parent b67d4ad805
commit f6fc863b48

View File

@@ -62,7 +62,7 @@ generateJson() {
url="${URL_BASE}/${ASSET_NAME}"
name="${RELEASE_VERSION}"
version="${BUILD_SOURCEVERSION}"
productVersion="${RELEASE_VERSION}"
productVersion="$( transformVersion "${RELEASE_VERSION}" )"
timestamp=$( node -e 'console.log(Date.now())' )
if [[ ! -f "assets/${ASSET_NAME}" ]]; then
@@ -94,6 +94,22 @@ generateJson() {
<<<'{}' )
}
transformVersion() {
local version
version="$1"
# Check if the version ends with -insider
if [[ "${version}" == *-insider ]]; then
# Remove -insider suffix, add .0 before it
echo "${version%-insider}.0-insider"
else
# Just add .0 at the end
echo "${version}.0"
fi
}
updateLatestVersion() {
echo "Updating ${VERSION_PATH}/latest.json"