Handle package download failure

This commit is contained in:
Andrew Schwartzmeyer committed 2016-09-02 17:17:20 -07:00
1 parent fc2e4e0e23
commit 363657717c
1 file changed
+5
+5
View File
@@ -70,6 +70,11 @@ packageuri=$(curl -s -i -H 'Accept: application/octet-stream' "https://api.githu
grep location | sed 's/location: //g') grep location | sed 's/location: //g')
curl -C - -o "$package" ${packageuri%$'\r'} curl -C - -o "$package" ${packageuri%$'\r'}
if [[ ! -r "$package" ]]; then
echo "ERROR: $package failed to download! Aborting..." >&2
exit 1
fi
# Installs PowerShell package # Installs PowerShell package
case "$OSTYPE" in case "$OSTYPE" in
linux*) linux*)