mirror of
https://github.com/outbackdingo/ghorg.git
synced 2026-01-27 10:19:03 +00:00
Update gitlab path trim prefix if not all-groups (#268)
* Update gitlab path trim prefix if not all-groups
This commit is contained in:
10
CHANGELOG.md
10
CHANGELOG.md
@@ -2,6 +2,16 @@
|
||||
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.2] - 12/31/22
|
||||
### Added
|
||||
### Changed
|
||||
### Deprecated
|
||||
### Removed
|
||||
### Fixed
|
||||
- GitLab nested group names; thanks @MaxG87
|
||||
### Security
|
||||
|
||||
## [1.9.1] - 12/11/22
|
||||
### Added
|
||||
- Ability to clone all users repos on hosted GitLab instances; thanks @mlaily
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
const ghorgVersion = "v1.9.1"
|
||||
const ghorgVersion = "v1.9.2"
|
||||
|
||||
var versionCmd = &cobra.Command{
|
||||
Use: "version",
|
||||
|
||||
@@ -13,8 +13,9 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
_ Client = Gitlab{}
|
||||
perPage = 100
|
||||
_ Client = Gitlab{}
|
||||
perPage = 100
|
||||
gitLabAllGroups = false
|
||||
)
|
||||
|
||||
func init() {
|
||||
@@ -41,6 +42,7 @@ func (c Gitlab) GetOrgRepos(targetOrg string) ([]Repo, error) {
|
||||
}
|
||||
|
||||
if targetOrg == "all-groups" {
|
||||
gitLabAllGroups = true
|
||||
longFetch = true
|
||||
|
||||
grps, err := c.GetTopLevelGroups()
|
||||
@@ -297,9 +299,10 @@ func (c Gitlab) filter(group string, ps []*gitlab.Project) []Repo {
|
||||
|
||||
path := p.PathWithNamespace
|
||||
|
||||
// For GitLab Cloud, the PathWithNamespace includes the org/group name
|
||||
// The PathWithNamespace includes the org/group name
|
||||
// https://github.com/gabrie30/ghorg/issues/228
|
||||
if os.Getenv("GHORG_SCM_BASE_URL") == "" {
|
||||
// https://github.com/gabrie30/ghorg/issues/267
|
||||
if !gitLabAllGroups {
|
||||
path = strings.TrimPrefix(path, group)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user