fix(npm): handle npmrc newline characters

Replace \n chars with newlines in npmrc before sending to ini.parse().

Closes #3417
This commit is contained in:
Rhys Arkins 2019-03-20 11:50:41 +01:00
parent 4379c4c2ac
commit 5d74650195

View file

@ -22,7 +22,7 @@ function setNpmrc(input) {
const existingNpmrc = npmrc; const existingNpmrc = npmrc;
npmrcRaw = input; npmrcRaw = input;
logger.debug('Setting npmrc'); logger.debug('Setting npmrc');
npmrc = ini.parse(input); npmrc = ini.parse(input.replace(/\\n/g, '\n'));
// massage _auth to _authToken // massage _auth to _authToken
for (const [key, val] of Object.entries(npmrc)) { for (const [key, val] of Object.entries(npmrc)) {
// istanbul ignore if // istanbul ignore if