(remote = "origin", opts?: any)
| 42 | } |
| 43 | |
| 44 | export function parseGitRepo(remote = "origin", opts?: any) { |
| 45 | // TODO: refactor based on TS feedback |
| 46 | // eslint-disable-next-line @typescript-eslint/ban-ts-comment |
| 47 | // @ts-ignore |
| 48 | log.silly("parseGitRepo"); |
| 49 | |
| 50 | const args = ["config", "--get", `remote.${remote}.url`]; |
| 51 | |
| 52 | // TODO: refactor based on TS feedback |
| 53 | // eslint-disable-next-line @typescript-eslint/ban-ts-comment |
| 54 | // @ts-ignore |
| 55 | log.verbose("git", args); |
| 56 | |
| 57 | const url = childProcess.execSync("git", args, opts); |
| 58 | |
| 59 | if (!url) { |
| 60 | throw new ValidationError("", `Git remote URL could not be found using "${remote}".`); |
| 61 | } |
| 62 | |
| 63 | return parseGitUrl(url); |
| 64 | } |
no test coverage detected