Begin move to project/alias by unique ID
This commit is contained in:
6
internal/cache/projects_alias.go
vendored
6
internal/cache/projects_alias.go
vendored
@@ -7,13 +7,15 @@ import (
|
||||
"text/tabwriter"
|
||||
|
||||
"github.com/pterm/pterm"
|
||||
"gitea.libretechconsulting.com/rmcguire/git-project-manager/internal/remotes/projects"
|
||||
"golang.org/x/exp/slices"
|
||||
|
||||
"gitea.libretechconsulting.com/rmcguire/git-project-manager/internal/remotes/projects"
|
||||
)
|
||||
|
||||
type ProjectAlias struct {
|
||||
Alias string
|
||||
ProjectID int
|
||||
ID string
|
||||
Remote string
|
||||
}
|
||||
|
||||
@@ -96,7 +98,7 @@ func (c *Cache) GetProjectByAlias(alias *ProjectAlias) *projects.Project {
|
||||
return nil
|
||||
}
|
||||
for _, p := range c.Projects {
|
||||
if p.ID == alias.ProjectID && p.Remote == alias.Remote {
|
||||
if p.GetID() == alias.ID {
|
||||
return p
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user