diff options
author | isaacs <i@izs.me> | 2011-10-26 03:56:28 +0400 |
---|---|---|
committer | isaacs <i@izs.me> | 2011-10-26 03:56:28 +0400 |
commit | d000a571bc216ab1a91b75bfd5cc9233f93ccc50 (patch) | |
tree | d129617816c5b56cf2677f73526012caa2f09fca /lib | |
parent | 2ad3917231c018485bd2d0aaee535a29ba324414 (diff) |
Close #1598 Don't set global path until after figuring out node location
Diffstat (limited to 'lib')
-rw-r--r-- | lib/utils/config-defs.js | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/lib/utils/config-defs.js b/lib/utils/config-defs.js index 71ce2ac58..e07025479 100644 --- a/lib/utils/config-defs.js +++ b/lib/utils/config-defs.js @@ -74,23 +74,24 @@ var home = ( process.platform === "win32" : process.env.HOME ) || temp var globalPrefix -if (process.env.PREFIX) { - globalPrefix = process.env.PREFIX -} else if (process.platform === "win32") { - // c:\node\node.exe --> prefix=c:\node\ - globalPrefix = path.join(process.execPath, "..") -} else { - // /usr/local/bin/node --> prefix=/usr/local - globalPrefix = path.join(process.execPath, "..", "..") +Object.defineProperty(exports, "defaults", {get: function () { + if (defaults) return defaults - // destdir only is respected on Unix - if (process.env.DESTDIR) { - globalPrefix = process.env.DESTDIR + "/" + globalPrefix + if (process.env.PREFIX) { + globalPrefix = process.env.PREFIX + } else if (process.platform === "win32") { + // c:\node\node.exe --> prefix=c:\node\ + globalPrefix = path.join(process.execPath, "..") + } else { + // /usr/local/bin/node --> prefix=/usr/local + globalPrefix = path.join(process.execPath, "..", "..") + + // destdir only is respected on Unix + if (process.env.DESTDIR) { + globalPrefix = process.env.DESTDIR + "/" + globalPrefix + } } -} -Object.defineProperty(exports, "defaults", {get: function () { - if (defaults) return defaults return defaults = { "always-auth" : false |