Files
mattermostest/scripts/patch_updater_yml.sh
Devin Binnie e674c5c28e [MM-45409] Restrict auto-update functionality specifically to the NSIS installer and AppImage (#2177)
* [MM-45409] Restrict auto-update functionality specifically to the NSIS installer and AppImage

* Fixes

* Fix syntax error

* Fixes #2

* Switch PR builds to ZIP

* Fix
2022-06-30 12:25:28 -04:00

21 lines
554 B
Bash
Executable File

#!/usr/bin/env bash
set -e
VERSION="$(jq -r '.version' <package.json)"
STABLE_VERSION="$(./node_modules/.bin/semver $VERSION -c)"
RELEASE_VERSION="${VERSION/$STABLE_VERSION/}"
RELEASE_VERSION="${RELEASE_VERSION/-/}"
RELEASE_VERSION="${RELEASE_VERSION%.*}"
if [ "$RELEASE_VERSION" == "" ]; then
RELEASE_VERSION="latest"
fi
echo "${RELEASE_VERSION}"
if [[ -f ./release/${RELEASE_VERSION}*.yml ]]; then
for i in ./release/${RELEASE_VERSION}*.yml; do
VERSION=$VERSION yq eval -i '.files[].url |= strenv(VERSION) + "/" + .' $i
done
fi