| .. | |||||
| clone.js | |||||
| errors.js | |||||
| find.js | |||||
| index.js | |||||
| is-clean.js | |||||
| is.js | |||||
| lines-to-revs.js | |||||
| make-error.js | |||||
| opts.js | |||||
| revs.js | |||||
| spawn.js | |||||
| utils.js | |||||
| which.js |
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
}
| .. | |||||
| clone.js | |||||
| errors.js | |||||
| find.js | |||||
| index.js | |||||
| is-clean.js | |||||
| is.js | |||||
| lines-to-revs.js | |||||
| make-error.js | |||||
| opts.js | |||||
| revs.js | |||||
| spawn.js | |||||
| utils.js | |||||
| which.js |