From 4e43b2c36ef4a8c0a2e4b55dcbdf5079339747de Mon Sep 17 00:00:00 2001 From: Nagi Letaifa Date: Sun, 24 Jul 2011 14:55:20 +0200 Subject: [PATCH] Fix #25 --- bin/n | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/bin/n b/bin/n index 8b6954c..36165c8 100755 --- a/bin/n +++ b/bin/n @@ -145,9 +145,16 @@ install_node() { local tarball="node-v$version.tar.gz" local logpath="/tmp/n.log" + local url="http://nodejs.org/dist" + local vtail="${version#*.}" + + if test "${vtail%.*}" -gt 4 && test "${vtail#*.}" -gt 0; then + url=$url"/v$version" + fi + # fetch and unpack cd $N_PREFIX/n \ - && $GET "http://nodejs.org/dist/$tarball" \ + && $GET "$url/$tarball" \ > $tarball \ && tar -zxf $tarball > $logpath 2>&1