Last change
on this file since bdd6491 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
323 bytes
|
Rev | Line | |
---|
[6a3a178] | 1 | const which = require('which')
|
---|
| 2 |
|
---|
| 3 | let gitPath
|
---|
| 4 | try {
|
---|
| 5 | gitPath = which.sync('git')
|
---|
| 6 | } catch (e) {}
|
---|
| 7 |
|
---|
| 8 | module.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.