Skip to content

Commit

Permalink
scripts/get_latest_release.sh: switch to python3-friendly print state…
Browse files Browse the repository at this point in the history
…ment (backwards compatible with python2)

Also, enabled `euo pipefail` and updated the script accordingly.  If the user was running python3, the `python` command would fail and the `demo-*` targets would continue with an empty `$BUILD_VERSION`.

Signed-off-by: Bill Robinson <dseevr@users.noreply.github.com>
  • Loading branch information
dseevr committed Aug 23, 2017
1 parent 5a2a959 commit 87bb33e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions scripts/get_latest_release.sh
@@ -1,7 +1,9 @@
#!/bin/bash

set -euo pipefail

# Check if the user requested a specific build
if [[ "$BUILD_VERSION" != "" ]]; then
if [[ ! -z "${BUILD_VERSION-}" ]]; then
echo $BUILD_VERSION
exit 0
fi
Expand All @@ -13,7 +15,7 @@ if [[ "$releases" != *"browser_download_url"* ]]; then
exit 1
fi

release=$(echo "$releases" | python -c 'import json, sys;print json.load(sys.stdin)["name"]')
release=$(echo "$releases" | python -c 'import json, sys; print(json.load(sys.stdin)["name"])')
echo $release

exit 0

0 comments on commit 87bb33e

Please sign in to comment.