mirror of
https://github.com/titanscouting/tra-analysis.git
synced 2025-10-24 09:59:21 +00:00
push all website files
This commit is contained in:
16
website/node_modules/npm/lib/utils/open-url.js
generated
vendored
Normal file
16
website/node_modules/npm/lib/utils/open-url.js
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
'use strict'
|
||||
const npm = require('../npm.js')
|
||||
const output = require('./output.js')
|
||||
const opener = require('opener')
|
||||
|
||||
// attempt to open URL in web-browser, print address otherwise:
|
||||
module.exports = function open (url, errMsg, cb, browser = npm.config.get('browser')) {
|
||||
opener(url, { command: npm.config.get('browser') }, (er) => {
|
||||
if (er && er.code === 'ENOENT') {
|
||||
output(`${errMsg}:\n\n${url}`)
|
||||
return cb()
|
||||
} else {
|
||||
return cb(er)
|
||||
}
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user