From 83bbae8a87b9cb34e3ccb74647e30274d438d054 Mon Sep 17 00:00:00 2001 From: fengmk2 Date: Tue, 10 Feb 2015 10:26:46 +0800 Subject: [PATCH] Support mirror Use same env names NVM_NODEJS_ORG_MIRROR and NVM_IOJS_ORG_MIRROR as nvm --- lib/install.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/install.js b/lib/install.js index 796bf37..56a53bb 100644 --- a/lib/install.js +++ b/lib/install.js @@ -22,7 +22,10 @@ var fs = require('graceful-fs') , mkdir = require('mkdirp') , win = process.platform == 'win32' , runtime = semver.parse(process.version).major < 1 ? 'node' : 'iojs' - , defaultDisturl = runtime == 'node' ? 'http://nodejs.org/dist' : 'https://iojs.org/dist' + , defaultDisturl = runtime == 'node' ? + (process.env.NVM_NODEJS_ORG_MIRROR || 'http://nodejs.org/dist') + : + (process.env.NVM_IOJS_ORG_MIRROR || 'https://iojs.org/dist') function install (gyp, argv, callback) {