diff options
Diffstat (limited to 'lib/utils/open-url.js')
-rw-r--r-- | lib/utils/open-url.js | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/utils/open-url.js b/lib/utils/open-url.js index 58227f039..a38a881b5 100644 --- a/lib/utils/open-url.js +++ b/lib/utils/open-url.js @@ -22,14 +22,12 @@ module.exports = function open (url, errMsg, cb, browser = npm.config.get('brows title: errMsg, url }, null, 2) - : `${errMsg}:\n\n${url}` + : `${errMsg}:\n ${url}\n` output(alternateMsg) } - const skipBrowser = process.argv.indexOf('--no-browser') > -1 - - if (skipBrowser) { + if (browser === false) { printAlternateMsg() return cb() } @@ -38,7 +36,8 @@ module.exports = function open (url, errMsg, cb, browser = npm.config.get('brows return cb(new Error('Invalid URL: ' + url)) } - opener(url, { command: browser }, (er) => { + const command = browser === true ? null : browser + opener(url, { command }, (er) => { if (er && er.code === 'ENOENT') { printAlternateMsg() return cb() |