Skip to content
This repository has been archived by the owner on Dec 24, 2018. It is now read-only.

Commit

Permalink
support latest version
Browse files Browse the repository at this point in the history
  • Loading branch information
fengmk2 committed Jan 20, 2015
1 parent 98b9c9a commit 0172da1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
10 changes: 8 additions & 2 deletions get_npm.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,24 @@ if (binType === 'iojs') {
var items = JSON.parse(content);
for (var i = 0; i < items.length; i++) {
var item = items[i];
if (item.version === binVersion) {
if (!npmVersion) {
// make sure has a npm version
npmVersion = item.npm;
}
if (item.version === binVersion && item.npm) {
npmVersion = item.npm;
break;
}
}

if (!npmVersion) {
return noNpmAndExit();
}
downloadNpmZip(npmVersion);
});
} else {
var pkgUri = util.format(NPM_PKG_JSON_URL, 'joyent/node', binVersion);
var pkgUri = util.format(NPM_PKG_JSON_URL, 'joyent/node',
binVersion === 'latest' ? 'master' : binVersion);
wget(pkgUri, function (filename, pkg) {
if (filename === null) {
return noNpmAndExit();
Expand Down
8 changes: 4 additions & 4 deletions nvmw.bat
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ if %NODE_VERSION:~4,1% == / (
)
)

if not %NODE_VERSION:~0,1% == v (
if not %NODE_VERSION:~0,1% == v if not %NODE_VERSION:~0,1% == l (
set NODE_VERSION=v%NODE_VERSION%
)

Expand Down Expand Up @@ -172,7 +172,7 @@ if %NODE_VERSION:~4,1% == / (
)
)

if not %NODE_VERSION:~0,1% == v (
if not %NODE_VERSION:~0,1% == v if not %NODE_VERSION:~0,1% == l (
set NODE_VERSION=v%NODE_VERSION%
)

Expand Down Expand Up @@ -215,7 +215,7 @@ if %NODE_VERSION:~4,1% == / (
)
)

if not %NODE_VERSION:~0,1% == v (
if not %NODE_VERSION:~0,1% == v if not %NODE_VERSION:~0,1% == l (
set NODE_VERSION=v%NODE_VERSION%
)
set "NODE_HOME=%NVMW_HOME%%NODE_TYPE%\%NODE_VERSION%"
Expand All @@ -236,7 +236,7 @@ if %NVMW_CURRENT:~4,1% == / (
)
)

if not %NVMW_CURRENT:~0,1% == v (
if not %NVMW_CURRENT:~0,1% == v if not %NVMW_CURRENT:~0,1% == l (
set NVMW_CURRENT=v%NVMW_CURRENT%
)
echo Now using %NVMW_CURRENT_TYPE% %NVMW_CURRENT%
Expand Down

0 comments on commit 0172da1

Please sign in to comment.