(projectRoot, args)
| 61 | } |
| 62 | |
| 63 | function runGit(projectRoot, args) { |
| 64 | try { |
| 65 | return spawnSync('git', args, { |
| 66 | cwd: projectRoot, |
| 67 | encoding: 'utf8', |
| 68 | stdio: ['ignore', 'pipe', 'pipe'], |
| 69 | }).stdout.trim(); |
| 70 | } catch { |
| 71 | return ''; |
| 72 | } |
| 73 | } |
| 74 | |
| 75 | function splitCommand(command) { |
| 76 | const matches = String(command || '').match(/"[^"]*"|'[^']*'|\S+/g) || []; |