%PDF- %PDF-
| Direktori : /usr/share/nodejs/@npmcli/git/lib/ |
| Current File : //usr/share/nodejs/@npmcli/git/lib/which.js |
const which = require('which')
let gitPath
try {
gitPath = which.sync('git')
} catch (e) {}
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
}