(remote: string = "origin")
| 10 | * @returns The remote URL or null if not found |
| 11 | */ |
| 12 | export function getGitRemoteUrl(remote: string = "origin"): string | null { |
| 13 | try { |
| 14 | const result = execSync(`git remote get-url ${remote}`, { |
| 15 | encoding: "utf-8", |
| 16 | cwd: process.cwd(), |
| 17 | stdio: "pipe", |
| 18 | }); |
| 19 | return result.trim(); |
| 20 | } catch { |
| 21 | return null; |
| 22 | } |
| 23 | } |
| 24 | |
| 25 | /** |
| 26 | * Get the current git branch name |
no outgoing calls
no test coverage detected