Comparing version 1.1.0 to 1.1.1
@@ -110,8 +110,30 @@ | ||
if (!conf.get('global')) { | ||
var projectConf = path.resolve(conf.localPrefix, '.npmrc') | ||
// If you're doing `npm --userconfig=~/foo.npmrc` then you'd expect | ||
// that ~/.npmrc won't override the stuff in ~/foo.npmrc (or, indeed | ||
// be used at all). | ||
// | ||
// However, if the cwd is ~, then ~/.npmrc is the home for the project | ||
// config, and will override the userconfig. | ||
// | ||
// If you're not setting the userconfig explicitly, then it will be loaded | ||
// twice, which is harmless but excessive. If you *are* setting the | ||
// userconfig explicitly then it will override your explicit intent, and | ||
// that IS harmful and unexpected. | ||
// | ||
// Solution: Do not load project config file that is the same as either | ||
// the default or resolved userconfig value. npm will log a "verbose" | ||
// message about this when it happens, but it is a rare enough edge case | ||
// that we don't have to be super concerned about it. | ||
var projectConf = path.resolve(conf.localPrefix, '.npmrc') | ||
var defaultUserConfig = rc.get('userconfig') | ||
var resolvedUserConfig = conf.get('userconfig') | ||
if (!conf.get('global') && | ||
projectConf !== defaultUserConfig && | ||
projectConf !== resolvedUserConfig) { | ||
conf.addFile(projectConf, 'project') | ||
conf.once('load', afterPrefix) | ||
} else { | ||
conf.add({}, 'project') | ||
afterPrefix() | ||
} | ||
else return afterPrefix() | ||
}) | ||
@@ -156,3 +178,3 @@ | ||
if(cafile) { | ||
if (cafile) { | ||
return conf.loadCAFile(cafile, finalize) | ||
@@ -159,0 +181,0 @@ } |
{ | ||
"name": "npmconf", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "The config thing npm uses", | ||
@@ -5,0 +5,0 @@ "main": "npmconf.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
40930
1166