Add better error message to all user clones

This commit is contained in:
Jay Gabriels
2022-12-11 08:33:14 -08:00
parent 636e98a9f6
commit e5820e2539
3 changed files with 5 additions and 2 deletions

View File

@@ -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

View File

@@ -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 {

View File

@@ -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