Skip to content
This repository was archived by the owner on Sep 10, 2025. It is now read-only.

Commit 0266387

Browse files
authored
Merge pull request #3 from skx/2-allow-ssh-prefix
Allow ssh:// prefix on ssh-clones
2 parents 6ab8ba0 + e5718bb commit 0266387

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

main.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ func main() {
187187
getOrgs := flag.String("organizations", "all", "Which organizational repositories to fetch.\nValid values are 'public', 'private', 'none', or 'all'.")
188188
getPersonal := flag.String("personal", "all", "Which personal repositories to fetch.\nValid values are 'public', 'private', 'none', or 'all'.")
189189
http := flag.Bool("http", false, "Generate HTTP-based clones rather than SSH-based ones.")
190+
ssh := flag.Bool("ssh", false, "Add 'ssh://'-prefix to the git clone command.")
190191
output := flag.String("output", "", "Write output to the named file, instead of printing to STDOUT.")
191192
prefix := flag.String("prefix", "", "The prefix beneath which to store the repositories upon the current system.")
192193
token := flag.String("token", "", "The API token used to authenticate to the remote API-host.")
@@ -367,6 +368,18 @@ func main() {
367368
clone = *repo.CloneURL
368369
}
369370

371+
//
372+
// Sometimes SSH clones need a prefix
373+
//
374+
if *ssh {
375+
clone = "ssh://" + clone
376+
}
377+
378+
//
379+
// Hack!
380+
//
381+
clone = strings.ReplaceAll(clone, ":4444:", ":4444/")
382+
370383
//
371384
// Should we exclude this entry?
372385
//

0 commit comments

Comments
 (0)