update
This commit is contained in:
18
package/node_modules/@npmcli/git/lib/which.js
generated
vendored
Normal file
18
package/node_modules/@npmcli/git/lib/which.js
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
const which = require('which')
|
||||
|
||||
let gitPath
|
||||
try {
|
||||
gitPath = which.sync('git')
|
||||
} catch {
|
||||
// ignore errors
|
||||
}
|
||||
|
||||
module.exports = (opts = {}) => {
|
||||
if (opts.git) {
|
||||
return opts.git
|
||||
}
|
||||
if (!gitPath || opts.git === false) {
|
||||
return Object.assign(new Error('No git binary found in $PATH'), { code: 'ENOGIT' })
|
||||
}
|
||||
return gitPath
|
||||
}
|
Reference in New Issue
Block a user