-
-
Save QAutomatron/4547bb5a823ee3651efcf7654af06dcf to your computer and use it in GitHub Desktop.
#!/bin/bash | |
BUILD=$1 | |
TOKEN=<hockey-app-token> | |
APP=<app-id> | |
VERSION=$(curl \ | |
-H "X-HockeyAppToken: $TOKEN" \ | |
https://rink.hockeyapp.net/api/2/apps/$APP/app_versions \ | |
| jq --arg BUILD "$BUILD" '.app_versions | .[] | select(.version==$BUILD) | .id') | |
curl -L -o $BUILD.apk https://rink.hockeyapp.net/api/2/apps/$APP/app_versions/$VERSION?format=apk | |
echo "!!!DONE!!!" |
@QAutomatron@AchrafAmil
MY .sh file is not working i have only changed TOKEN & APP value:
#!/bin/bash
BUILD=$1
TOKEN=2e
APP=0*****3
VERSION=$(curl \
-H "X-HockeyAppToken: $TOKEN" \
https://rink.hockeyapp.net/api/2/apps/$APP/app_versions \
| jq --arg BUILD "$BUILD" '.app_versions | .[] | select(.version==$BUILD) | .id')
curl -L -o $BUILD.apk https://rink.hockeyapp.net/api/2/apps/$APP/app_versions/$VERSION?format=apk
echo "!!!DONE!!!"
I am getting below error:
$ bash /cygdrive/d/appDownload.sh
/cygdrive/d/appDownload.sh: command substitution: line 12: syntax error near unexpected token |' /cygdrive/d/appDownload.sh: command substitution: line 12:
| jq --arg BUILD'"$BUILD" '.app_versions | .[] | select(.version==$BUILD) | .id')
/cygdrive/d/appDownload.sh: line 9: curl: command not found
!!!DONE!!!
Could you please help me with this.
I change TOKEN & APP but it only downloads a 48 bytes .apk file.