Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
which.js19 linesDownload Raw Back to lib
1const which = require('which')
2
3let gitPath
4try {
5  gitPath = which.sync('git')
6} catch {
7  // ignore errors
8}
9
10module.exports = (opts = {}) => {
11  if (opts.git) {
12    return opts.git
13  }
14  if (!gitPath || opts.git === false) {
15    return Object.assign(new Error('No git binary found in $PATH'), { code: 'ENOGIT' })
16  }
17  return gitPath
18}
19 
codekingpro/portable-devtools · Team Ai