Update haos-vm.sh

pull/152/head
tteckster 2022-04-16 13:56:29 -04:00 committed by GitHub
parent 154364de86
commit 330d42aee8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 7 deletions

View File

@ -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