Get the latest VMDK released
This commit is contained in:
parent
085b0bb991
commit
2a70b855f5
14
install.sh
14
install.sh
@ -84,13 +84,21 @@ msg "Getting URL for latest Home Assistant disk image..."
|
|||||||
RELEASE_EXT=vmdk.gz
|
RELEASE_EXT=vmdk.gz
|
||||||
URL=$(cat<<EOF | python3
|
URL=$(cat<<EOF | python3
|
||||||
import requests
|
import requests
|
||||||
url = 'https://api.github.com/repos/home-assistant/operating-system/releases/latest'
|
url = 'https://api.github.com/repos/home-assistant/operating-system/releases'
|
||||||
r = requests.get(url).json()
|
r = requests.get(url).json()
|
||||||
if 'message' in r:
|
if 'message' in r:
|
||||||
exit()
|
exit()
|
||||||
for asset in r['assets']:
|
for release in r:
|
||||||
|
if not release['prerelease']:
|
||||||
|
continue
|
||||||
|
for asset in release['assets']:
|
||||||
if asset['name'].endswith('$RELEASE_EXT'):
|
if asset['name'].endswith('$RELEASE_EXT'):
|
||||||
print(asset['browser_download_url'])
|
global image_url
|
||||||
|
image_url = asset['browser_download_url']
|
||||||
|
break
|
||||||
|
if 'image_url' in globals():
|
||||||
|
print(image_url)
|
||||||
|
break
|
||||||
EOF
|
EOF
|
||||||
)
|
)
|
||||||
if [ -z "$URL" ]; then
|
if [ -z "$URL" ]; then
|
||||||
|
Loading…
Reference in New Issue
Block a user