mirror of
https://github.com/outbackdingo/ghorg.git
synced 2026-01-27 18:18:58 +00:00
Update github scm to know when user is cloning own repos (#201)
This commit is contained in:
11
CHANGELOG.md
11
CHANGELOG.md
@@ -3,7 +3,7 @@ All notable changes to this project will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
||||
|
||||
## [1.7.13] - unreleased
|
||||
## [1.7.14] - Unreleased
|
||||
### Added
|
||||
### Changed
|
||||
### Deprecated
|
||||
@@ -11,6 +11,15 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
||||
### Fixed
|
||||
### Security
|
||||
|
||||
## [1.7.13] - 4/17/22
|
||||
### Added
|
||||
### Changed
|
||||
### Deprecated
|
||||
### Removed
|
||||
### Fixed
|
||||
- User cloning self on github now finds all public/private repos; thanks @iDoka
|
||||
### Security
|
||||
|
||||
## [1.7.12] - 5/19/22
|
||||
### Added
|
||||
- Dockerfile
|
||||
|
||||
@@ -422,7 +422,7 @@ func CloneAllRepos(git git.Gitter, cloneTargets []scm.Repo) {
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
colorlog.PrintInfo("Using ghorgignore, filtering repos down...\n")
|
||||
colorlog.PrintInfo("\nUsing ghorgignore, filtering repos down...\n")
|
||||
|
||||
filteredCloneTargets := []scm.Repo{}
|
||||
var flag bool
|
||||
|
||||
@@ -11,6 +11,6 @@ var versionCmd = &cobra.Command{
|
||||
Short: "Print the version number of Ghorg",
|
||||
Long: `All software has versions. This is Ghorg's`,
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
fmt.Println("v1.7.12")
|
||||
fmt.Println("v1.7.13")
|
||||
},
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ func (c Github) GetOrgRepos(targetOrg string) ([]Repo, error) {
|
||||
}
|
||||
|
||||
if opt.Page%12 == 0 && opt.Page != 0 {
|
||||
colorlog.PrintSubtleInfo("Everything is okay, its just a lot of repos...")
|
||||
colorlog.PrintSubtleInfo("\nEverything is okay, the org just has a lot of repos...")
|
||||
}
|
||||
opt.Page = resp.NextPage
|
||||
}
|
||||
@@ -63,6 +63,14 @@ func (c Github) GetOrgRepos(targetOrg string) ([]Repo, error) {
|
||||
|
||||
// GetUserRepos gets user repos
|
||||
func (c Github) GetUserRepos(targetUser string) ([]Repo, error) {
|
||||
|
||||
userToken, _, _ := c.Users.Get(context.Background(), "")
|
||||
|
||||
if targetUser == userToken.GetLogin() {
|
||||
colorlog.PrintSubtleInfo("\nCloning all your public/private repos. This process may take a bit longer than other clones, please be patient...")
|
||||
targetUser = ""
|
||||
}
|
||||
|
||||
if os.Getenv("GHORG_SCM_BASE_URL") != "" {
|
||||
c.BaseURL, _ = url.Parse(os.Getenv("GHORG_SCM_BASE_URL"))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user