(gitCommand)
| 44 | // Helper methods |
| 45 | |
| 46 | function execGitCommand(gitCommand) { |
| 47 | const output = execSync(gitCommand, {silent: true}); |
| 48 | if (output.code !== 0) { |
| 49 | console.error(`Error: git command "${gitCommand}" failed: \n\n ${output.stderr}`); |
| 50 | process.exit(1); |
| 51 | } |
| 52 | return output; |
| 53 | } |
| 54 | |
| 55 | function toArray(rawGitCommandOutput) { |
| 56 | return rawGitCommandOutput.trim().split('\n'); |