From 05f528aa1673797d8e3b81dd74418d301908a131 Mon Sep 17 00:00:00 2001 From: Will Farrington Date: Sun, 24 Mar 2013 18:21:07 -0400 Subject: [PATCH] Try to use alternate source download when default is MIA. Fixes #5 --- libexec/nodenv-install | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libexec/nodenv-install b/libexec/nodenv-install index c20021f..1d72f06 100755 --- a/libexec/nodenv-install +++ b/libexec/nodenv-install @@ -32,12 +32,14 @@ cd "$version_dir" if [ "$compile" = "--source" ]; then # Let's fetch the source and build it download="http://nodejs.org/dist/${version}/node-${version}.tar.gz" + alt_download="http://nodejs.org/dist/node-${version}.tar.gz" # Can't get too clever here set +e # Download source and compile it - curl -s -f "$download" > /tmp/node-$version.tar.gz && \ + (curl -s -f "$download" > /tmp/node-$version.tar.gz || \ + curl -s -f "$alt_download" > /tmp/node-$version.tar.gz) && \ tar zxf /tmp/node-$version.tar.gz -C /tmp && \ cd /tmp/node-$version && \ (./configure --prefix="$version_dir" && make && make install) 2>&1 > /tmp/nodenv-install-$version.log && \