(opts: RemoteAddWithDeps)
| 438 | } |
| 439 | |
| 440 | export async function remoteAddWith(opts: RemoteAddWithDeps): Promise<void> { |
| 441 | const dir = opts.dir ?? "/"; |
| 442 | try { |
| 443 | await opts.git.addRemote({ |
| 444 | fs: opts.fs, |
| 445 | dir, |
| 446 | remote: opts.name, |
| 447 | url: opts.url, |
| 448 | force: opts.force, |
| 449 | }); |
| 450 | } catch (cause) { |
| 451 | if (isNotARepositoryCause(cause)) throw new NotARepositoryError(dir, { cause }); |
| 452 | throw new GitError("EREMOTEFAIL", `git remote add failed: ${errorMessage(cause)}`, { |
| 453 | cause, |
| 454 | }); |
| 455 | } |
| 456 | } |
| 457 | |
| 458 | export interface GitRemoteRemoveOptions { |
| 459 | dir?: string; |
no test coverage detected