source: trip-planner-front/node_modules/@npmcli/git/lib/which.js@ 8d391a1

Last change on this file since 8d391a1 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 323 bytes
Line 
1const which = require('which')
2
3let gitPath
4try {
5 gitPath = which.sync('git')
6} catch (e) {}
7
8module.exports = (opts = {}) => {
9 if (opts.git) {
10 return opts.git
11 }
12 if (!gitPath || opts.git === false) {
13 return Object.assign(new Error('No git binary found in $PATH'), { code: 'ENOGIT' })
14 }
15 return gitPath
16}
Note: See TracBrowser for help on using the repository browser.