Auto-select project if singular after merge
This commit is contained in:
parent
50070cc667
commit
46ae4af9cd
@ -49,5 +49,5 @@ The basic workflow looks like this:
|
||||
- [ ] Make a Makefile
|
||||
- [ ] Add git repo status to project go (up-to-date, pending commits, etc..)
|
||||
- [x] Merge aliases together for same project when selecting
|
||||
- [ ] If after merging there is only one project, go there by default
|
||||
- [x] If after merging there is only one project, go there by default
|
||||
|
||||
|
@ -24,7 +24,7 @@ func projectGoCmdRun(cmd *cobra.Command, args []string) {
|
||||
if len(args) > 0 {
|
||||
term = args[0]
|
||||
}
|
||||
// project := getProject(args)
|
||||
|
||||
project := fzfSearchProjectAliases(term)
|
||||
|
||||
if project == nil {
|
||||
|
@ -77,6 +77,9 @@ func fzfAliasFromAliases(ctx context.Context, aliases []*projects.ProjectAlias)
|
||||
func fzfProjectFromAliases(ctx context.Context, aliases []*projects.ProjectAlias) (
|
||||
*gitlab.Project, error) {
|
||||
mergedProjects := projectsFromAliases(aliases)
|
||||
if len(mergedProjects) == 1 {
|
||||
return mergedProjects[0], nil
|
||||
}
|
||||
return fzfProjectFromProjects(ctx, mergedProjects)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user