diff --git a/index.js b/index.js index 22fad5e..f0dba0a 100755 --- a/index.js +++ b/index.js @@ -113,7 +113,9 @@ function localBinPath (cwd) { module.exports._getEnv = getEnv function getEnv (opts) { - return child.exec(opts.npm, ['run', 'env']).then(require('dotenv').parse) + return child.exec(opts.npm, [ + 'run', 'env', '--parseable' + ]).then(require('dotenv').parse) } module.exports._ensurePackages = ensurePackages @@ -165,7 +167,7 @@ function getExistingPath (command, opts) { module.exports._getNpmCache = getNpmCache function getNpmCache (opts) { return which(opts.npm).then(npmPath => { - const args = ['config', 'get', 'cache'] + const args = ['config', 'get', 'cache', '--parseable'] if (opts.userconfig) { args.push('--userconfig', child.escapeArg(opts.userconfig, true)) } diff --git a/test/index.js b/test/index.js index 992ad30..5511d0b 100644 --- a/test/index.js +++ b/test/index.js @@ -160,12 +160,12 @@ test('getNpmCache', t => { } })._getNpmCache return getCache({npm}).then(cache => { - t.equal(cache, `${npm} config get cache`, 'requests cache from npm') + t.equal(cache, `${npm} config get cache --parseable`, 'requests cache from npm') return getCache({npm, userconfig}) }).then(cache => { t.equal( cache, - `${npm} config get cache --userconfig ${ + `${npm} config get cache --parseable --userconfig ${ userconfig }-escaped-as-path-true`, 'added userconfig if option present'