Skip to content

Commit

Permalink
Add better error message to all user clones
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrie30 committed Dec 11, 2022
1 parent 636e98a commit e5820e2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,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.9.1] - unreleased
## [1.9.1] - 12/11/22
### Added
- Ability to clone all users repos on hosted GitLab instances; thanks @mlaily
### Changed
Expand Down
1 change: 0 additions & 1 deletion cmd/clone.go
Original file line number Diff line number Diff line change
Expand Up @@ -985,7 +985,6 @@ func setOutputDirName(argz []string) {
outputDirName = strings.TrimSuffix(strings.TrimPrefix(u.Host, "www."), ".com")
}

// If all-group is used set the parent folder to the name of the baseurl
if argz[0] == "all-users" && os.Getenv("GHORG_SCM_BASE_URL") != "" {
u, err := url.Parse(os.Getenv("GHORG_SCM_BASE_URL"))
if err != nil {
Expand Down
4 changes: 4 additions & 0 deletions scm/gitlab.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ func (c Gitlab) GetOrgRepos(targetOrg string) ([]Repo, error) {
repoData := []Repo{}
longFetch := false

if targetOrg == "all-users" {
colorlog.PrintErrorAndExit("When using the 'all-users' keyword the '--clone-type=user' flag should be set")
}

if targetOrg == "all-groups" {
longFetch = true

Expand Down

0 comments on commit e5820e2

Please sign in to comment.