This commit is contained in:
pavel 2026-05-15 18:24:57 +02:00
commit 22c2f68c2a
3 changed files with 30 additions and 11 deletions

View file

@ -457,12 +457,26 @@ func printCLIProject(action string, p Project) {
}
if p.RepoURL != "" {
fmt.Printf("repo_url=%s\n", p.RepoURL)
fmt.Printf("clone_url=%s\n", normalizeCloneURL(p.RepoURL))
}
if p.WebhookURL != "" {
fmt.Printf("webhook_url=%s\n", p.WebhookURL)
}
}
func normalizeCloneURL(repoURL string) string {
u := strings.TrimSpace(repoURL)
if u == "" {
return ""
}
if strings.HasPrefix(u, "http://") || strings.HasPrefix(u, "https://") {
if !strings.HasSuffix(strings.ToLower(u), ".git") {
return u + ".git"
}
}
return u
}
func cliStatePath() string {
home, err := os.UserHomeDir()
if err != nil || home == "" {