<NME> patch_updater_yml.sh
<BEF> #!/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


<MSG> [MM-45519] Fix auto updater file patch script (#2189)


<DFF> @@ -12,7 +12,7 @@ if [ "$RELEASE_VERSION" == "" ]; then
 fi
 
 echo "${RELEASE_VERSION}"
-if [[ -f ./release/${RELEASE_VERSION}*.yml ]]; then
+if compgen -G "./release/${RELEASE_VERSION}*.yml" > /dev/null; then
     for i in ./release/${RELEASE_VERSION}*.yml; do
         VERSION=$VERSION yq eval -i '.files[].url |= strenv(VERSION) + "/" + .' $i
     done

{'commit': 'diff --git a/scripts/patch_updater_yml.sh b/scripts/patch_updater_yml.sh\nindex 2a84baef..cbc24262 100755\n--- a/scripts/patch_updater_yml.sh\n+++ b/scripts/patch_updater_yml.sh\n@@ -12,7 +12,7 @@ if [ "$RELEASE_VERSION" == "" ]; then\n fi\n \n echo "${RELEASE_VERSION}"\n-if [[ -f ./release/${RELEASE_VERSION}*.yml ]]; then\n+if compgen -G "./release/${RELEASE_VERSION}*.yml" > /dev/null; then\n     for i in ./release/${RELEASE_VERSION}*.yml; do\n         VERSION=$VERSION yq eval -i \'.files[].url |= strenv(VERSION) + "/" + .\' $i\n     done\n', 'commit_subject': '[MM-45519] Fix auto updater file patch script (#2189)', 'repo_name': 'mattermost/desktop', 'committer': {'name': 'GitHub', 'email': '1505422b2465e9a84f6fdfaa161078890c593f06@github.com', 'time_sec': '1657041059', 'tz_offset': '-240', 'date': {'seconds': '1657041059'}}, 'commit_tree': '09fa63c1d5dbd9d55f9b5b7ea6d3da3e1768dccb', 'commit_message': '[MM-45519] Fix auto updater file patch script (#2189)\n\n', 'language_name': 'JavaScript', 'license': 'apache-2.0', 'hunks': '@@ -12,7 +12,7 @@ if [ "$RELEASE_VERSION" == "" ]; then\n fi\n \n echo "${RELEASE_VERSION}"\n-if [[ -f ./release/${RELEASE_VERSION}*.yml ]]; then\n+if compgen -G "./release/${RELEASE_VERSION}*.yml" > /dev/null; then\n     for i in ./release/${RELEASE_VERSION}*.yml; do\n         VERSION=$VERSION yq eval -i \'.files[].url |= strenv(VERSION) + "/" + .\' $i\n     done\n', 'addition_count': 1, 'deletion_count': 1, 'src_file': 'a/scripts/patch_updater_yml.sh', 'tgt_file': 'b/scripts/patch_updater_yml.sh', 'file_extension': '.sh', 'before_file': '#!/usr/bin/env bash\nset -e\n\nVERSION="$(jq -r \'.version\' <package.json)"\nSTABLE_VERSION="$(./node_modules/.bin/semver $VERSION -c)"\nRELEASE_VERSION="${VERSION/$STABLE_VERSION/}"\nRELEASE_VERSION="${RELEASE_VERSION/-/}"\nRELEASE_VERSION="${RELEASE_VERSION%.*}"\n\nif [ "$RELEASE_VERSION" == "" ]; then\n    RELEASE_VERSION="latest"\nfi\n\necho "${RELEASE_VERSION}"\nif [[ -f ./release/${RELEASE_VERSION}*.yml ]]; then\n    for i in ./release/${RELEASE_VERSION}*.yml; do\n        VERSION=$VERSION yq eval -i \'.files[].url |= strenv(VERSION) + "/" + .\' $i\n    done\nfi\n\n', 'message': '[MM-45519] Fix auto updater file patch script (#2189)\n\n', 'author_name': 'GitHub', 'lang': 'sh'}