mirror of
https://github.com/taigrr/github2mr.git
synced 2026-04-02 03:09:09 -07:00
Merge pull request #7 from skx/6-exclude-archived
Exclude archived repositories by default.
This commit is contained in:
@@ -75,6 +75,7 @@ You can run `github2mr -help` to see available options, but in brief:
|
|||||||
* Or the reverse, ignoring all personal-repositories.
|
* Or the reverse, ignoring all personal-repositories.
|
||||||
* You can exclude repositories by name.
|
* You can exclude repositories by name.
|
||||||
* You can default to cloning repositories via HTTP, instead of SSH.
|
* You can default to cloning repositories via HTTP, instead of SSH.
|
||||||
|
* By default all _archived_ repositories are excluded.
|
||||||
|
|
||||||
|
|
||||||
## Other Git Hosts
|
## Other Git Hosts
|
||||||
|
|||||||
10
main.go
10
main.go
@@ -181,6 +181,7 @@ func main() {
|
|||||||
//
|
//
|
||||||
// Parse flags
|
// Parse flags
|
||||||
//
|
//
|
||||||
|
archived := flag.Bool("archived", false, "Include archived repositories in the output?")
|
||||||
api := flag.String("api", "https://api.github.com/", "The API end-point to use for the remote git-host.")
|
api := flag.String("api", "https://api.github.com/", "The API end-point to use for the remote git-host.")
|
||||||
authHeader := flag.Bool("auth-header-token", false, "Use an authorization-header including 'token' rather than 'bearer'.\nThis is required for gitbucket, and perhaps other systems.")
|
authHeader := flag.Bool("auth-header-token", false, "Use an authorization-header including 'token' rather than 'bearer'.\nThis is required for gitbucket, and perhaps other systems.")
|
||||||
exclude := flag.String("exclude", "", "Comma-separated list of repositories to exclude.")
|
exclude := flag.String("exclude", "", "Comma-separated list of repositories to exclude.")
|
||||||
@@ -360,6 +361,15 @@ func main() {
|
|||||||
//
|
//
|
||||||
for _, repo := range all {
|
for _, repo := range all {
|
||||||
|
|
||||||
|
//
|
||||||
|
// If the repository is archived then
|
||||||
|
// skip it, unless we're supposed to keep
|
||||||
|
// it.
|
||||||
|
//
|
||||||
|
if *repo.Archived && !*archived {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// The clone-type is configurable
|
// The clone-type is configurable
|
||||||
//
|
//
|
||||||
|
|||||||
Reference in New Issue
Block a user