Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Handle curl failures properly

  • Loading branch information...
commit 52c1451e653e105599f8867fc580948910163da6 1 parent b392b10
@isaacs authored
Showing with 6 additions and 3 deletions.
  1. +6 −3 nave.sh
View
9 nave.sh
@@ -134,10 +134,13 @@ nave_fetch () {
"http://nodejs.org/dist/node-$version.tar.gz"
)
for url in "${urls[@]}"; do
- curl -#Lf "$url" \
- | $tar xzf - -C "$src" --strip-components=1
+ curl -#Lf "$url" > "$src".tgz
if [ $? -eq 0 ]; then
- return 0
+ $tar xzf "$src".tgz -C "$src" --strip-components=1
+ if [ $? -eq 0 ]; then
+ echo "fetched from $url"
+ return 0
+ fi
fi
done
Please sign in to comment.
Something went wrong with that request. Please try again.