Skip to content

Commit

Permalink
Try to use alternate source download when default is MIA.
Browse files Browse the repository at this point in the history
Fixes #5
  • Loading branch information
wfarr committed Mar 24, 2013
1 parent 811fc1f commit 05f528a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion libexec/nodenv-install
Original file line number Diff line number Diff line change
Expand Up @@ -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 && \
Expand Down

0 comments on commit 05f528a

Please sign in to comment.