(dir: string)
| 5 | const d = debug('electron-forge:init:git'); |
| 6 | |
| 7 | export const initGit = async (dir: string): Promise<void> => { |
| 8 | await new Promise<void>((resolve, reject) => { |
| 9 | exec( |
| 10 | 'git rev-parse --show-toplevel', |
| 11 | { |
| 12 | cwd: dir, |
| 13 | }, |
| 14 | (err) => { |
| 15 | if (err) { |
| 16 | // not run within a Git repository |
| 17 | d('executing "git init" in directory:', dir); |
| 18 | exec('git init', { cwd: dir }, (initErr) => |
| 19 | initErr ? reject(initErr) : resolve(), |
| 20 | ); |
| 21 | } else { |
| 22 | d('.git directory already exists, skipping git initialization'); |
| 23 | resolve(); |
| 24 | } |
| 25 | }, |
| 26 | ); |
| 27 | }); |
| 28 | }; |
no outgoing calls
no test coverage detected