Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In win32 platform, %APPDATA%\npm\etc\ should coresspond to /etc. #88

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions index.js
Expand Up @@ -2,8 +2,10 @@
var cc = require('./lib/utils')
var join = require('path').join
var deepExtend = require('deep-extend')
var etc = '/etc'
var win = process.platform === "win32"
var etc = win
? join(process.env.APPDATA, 'npm', 'etc')
: '/etc'
var home = win
? process.env.USERPROFILE
: process.env.HOME
Expand Down Expand Up @@ -34,7 +36,7 @@ module.exports = function (name, defaults, argv, parse) {
}

// which files do we look at?
if (!win)
if (etc)
[join(etc, name, 'config'),
join(etc, name + 'rc')].forEach(addConfigFile)
if (home)
Expand Down