summaryrefslogtreecommitdiff
path: root/deps/npm/scripts/install.sh
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/scripts/install.sh')
-rwxr-xr-xdeps/npm/scripts/install.sh11
1 files changed, 10 insertions, 1 deletions
diff --git a/deps/npm/scripts/install.sh b/deps/npm/scripts/install.sh
index 7a0a45f5d..74840459e 100755
--- a/deps/npm/scripts/install.sh
+++ b/deps/npm/scripts/install.sh
@@ -17,7 +17,16 @@ if [ "x$0" = "xsh" ]; then
# on some systems, you can just do cat>npm-install.sh
# which is a bit cuter. But on others, &1 is already closed,
# so catting to another script file won't do anything.
- curl -s https://npmjs.org/install.sh > npm-install-$$.sh
+ # Follow Location: headers, and fail on errors
+ curl -f -L -s https://www.npmjs.org/install.sh > npm-install-$$.sh
+ ret=$?
+ if [ $ret -eq 0 ]; then
+ (exit 0)
+ else
+ rm npm-install-$$.sh
+ echo "Failed to download script" >&2
+ exit $ret
+ fi
sh npm-install-$$.sh
ret=$?
rm npm-install-$$.sh