From 9a93c240cee53a91dce6b96d4eb97c21382adee7 Mon Sep 17 00:00:00 2001 From: cnwhy Date: Thu, 14 Nov 2013 16:39:31 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=B8=8B=E8=BD=BDtar.gz?= =?UTF-8?q?=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 默认安装最近的稳定版。 修复安装高版本(0.6.9以上版本)时,下载路径出错的问题。 --- node_setup.sh | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/node_setup.sh b/node_setup.sh index 77df4f0..826f9c6 100644 --- a/node_setup.sh +++ b/node_setup.sh @@ -4,7 +4,8 @@ # bjzllou 2012-08-13 if [ $# -eq 0 ]; then - VERSION=0.6.4 + VERSION=latest + else VERSION=$1 fi @@ -12,8 +13,16 @@ fi echo "install v$VERSION of node..." sleep 1 -NODE_VERSION=node-v$VERSION -NODE_TAR=${NODE_VERSION}.tar.gz +if [ "$VERSION" = "latest" ] then + NODE_VERSION=node-$VERSION + NODE_TAR=${NODE_VERSION}.tar.gz + DOWNLOAD_URL=http://nodejs.org/dist/v${VERSION}/${NODE_TAR} +else + NODE_VERSION=node-v$VERSION + NODE_TAR=${NODE_VERSION}.tar.gz + DOWNLOAD_URL=http://nodejs.org/dist/${NODE_TAR} +fi + APP_HOME=/home/app DOWNLOAD_HOME=/home/download @@ -42,7 +51,7 @@ if [ -f $NODE_TAR ]; then echo 'found' else echo "download $NODE_VERSION..." - wget http://nodejs.org/dist/${NODE_TAR} + wget $DOWNLOAD_URL fi tar -zxvf $NODE_TAR From aada230a165cec3b5ec911c0e1da7f2ab59b7f07 Mon Sep 17 00:00:00 2001 From: cnwhy Date: Thu, 9 Jan 2014 10:49:14 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=8B=E8=BD=BD?= =?UTF-8?q?=E5=8C=85=E8=B7=AF=E5=BE=84=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- node_setup.sh | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/node_setup.sh b/node_setup.sh index 826f9c6..cefed70 100644 --- a/node_setup.sh +++ b/node_setup.sh @@ -5,7 +5,6 @@ if [ $# -eq 0 ]; then VERSION=latest - else VERSION=$1 fi @@ -13,14 +12,14 @@ fi echo "install v$VERSION of node..." sleep 1 -if [ "$VERSION" = "latest" ] then - NODE_VERSION=node-$VERSION - NODE_TAR=${NODE_VERSION}.tar.gz - DOWNLOAD_URL=http://nodejs.org/dist/v${VERSION}/${NODE_TAR} +if [ "$VERSION" = "latest" ]; then + NODE_VERSION=node-latest + NODE_TAR=node-latest.tar.gz + DOWNLOAD_URL=http://nodejs.org/dist/node-latest.tar.gz else NODE_VERSION=node-v$VERSION NODE_TAR=${NODE_VERSION}.tar.gz - DOWNLOAD_URL=http://nodejs.org/dist/${NODE_TAR} + DOWNLOAD_URL=http://nodejs.org/dist/v${VERSION}/${NODE_TAR} fi APP_HOME=/home/app