Skip to content
This repository has been archived by the owner on Aug 11, 2022. It is now read-only.

Commit

Permalink
Close #1598 Don't set global path until after figuring out node location
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed Oct 25, 2011
1 parent 2ad3917 commit d000a57
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions lib/utils/config-defs.js
Expand Up @@ -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

Expand Down

0 comments on commit d000a57

Please sign in to comment.