Fixed curl statement to check return HEADERS.

This commit is contained in:
Chris Kleeschulte 2015-08-06 11:28:17 -04:00
parent 19fdd54cdc
commit c94f493915
1 changed files with 12 additions and 8 deletions

View File

@ -10,13 +10,17 @@ binary_url="https://${bucket_name}.s3.amazonaws.com/${tarball_name}"
echo "Downloading binary: ${binary_url}"
curl $binary_url > $tarball_name
curl --fail -I $binary_url
if test -e "${tarball_name}"; then
echo "Unpacking binary distribution"
tar -xvzf $tarball_name
exit 0;
else
echo "Prebuild binary could not be downloaded, building from source..."
./bin/build
if test $? -eq 0; then
curl $binary_url > $tarball_name
if test -e "${tarball_name}"; then
echo "Unpacking binary distribution"
tar -xvzf $tarball_name
if test $? -eq 0; then
exit 0
fi
fi
fi
echo "Prebuild binary could not be downloaded, building from source..."
./bin/build