Adding jq to install and adding error handling on curl call

This commit is contained in:
Michael Tryby
2019-03-05 17:24:14 -05:00
parent f33257fce7
commit 12bbeb4921
2 changed files with 7 additions and 1 deletions

View File

@@ -60,7 +60,12 @@ SUT_PATH=(`find $BUILD_HOME -name "bin" -type d`)
# TODO: determine platform
# determine latest tag from GitHub API
LATEST_TAG=(`curl --silent "https://api.github.com/repos/openwateranalytics/epanet-example-networks/releases/latest" | jq -r .tag_name`)
LATEST_URL="https://api.github.com/repos/openwateranalytics/epanet-example-networks/releases/latest"
LATEST_TAG=(`curl --silent ${LATEST_URL} | jq -r .tag_name`)
if [ -z $LATEST_TAG ]; then
echo "ERROR: curl - ${LATEST_URL}"
exit 1
fi
TEST_URL="https://github.com/OpenWaterAnalytics/epanet-example-networks/archive/${LATEST_TAG}.tar.gz"
BENCH_URL="https://github.com/OpenWaterAnalytics/epanet-example-networks/releases/download/${LATEST_TAG}/benchmark-${PLATFORM}-${REF_BUILD_ID}.tar.gz"