From 330d42aee8946e2f9acf4d5f46af94d228731ae8 Mon Sep 17 00:00:00 2001 From: tteckster Date: Sat, 16 Apr 2022 13:56:29 -0400 Subject: [PATCH] Update haos-vm.sh --- vm/haos-vm.sh | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/vm/haos-vm.sh b/vm/haos-vm.sh index 1d499d81..a7f95560 100644 --- a/vm/haos-vm.sh +++ b/vm/haos-vm.sh @@ -122,13 +122,16 @@ r = requests.get(url).json() if "message" in r: exit() for release in r: - if release["prerelease"]: - continue - if asset in release["assets"]: - if asset["name"].find("$RELEASE_TYPE") != -1: - image_url = asset["browser_download_url"] - print(image_url) - exit() + if not release['prerelease']: + continue + for asset in release['assets']: + if asset['name'].endswith('$RELEASE_EXT'): + global image_url + image_url = asset['browser_download_url'] + break + if 'image_url' in globals(): + print(image_url) + break EOF ) if [ -z "$URL" ]; then