(repoPath: string, remoteName = 'origin', branch = 'main')
| 161 | } |
| 162 | |
| 163 | export function pushToRemote(repoPath: string, remoteName = 'origin', branch = 'main') { |
| 164 | try { |
| 165 | runGit(['push', '-u', remoteName, branch], repoPath); |
| 166 | } catch (error) { |
| 167 | if (error instanceof GitError) { |
| 168 | runGit(['push', '-u', '--force', remoteName, branch], repoPath); |
| 169 | } else { |
| 170 | throw error; |
| 171 | } |
| 172 | } |
| 173 | } |
| 174 | |
| 175 | export function ensureGitRepository(repoPath: string) { |
| 176 | if (!fs.existsSync(repoPath)) { |
no test coverage detected