only check for build button on a go.wit.com/apps

This commit is contained in:
Jeff Carr 2024-02-22 15:54:36 -06:00
parent abd6ace49e
commit 1a3ac68730
2 changed files with 17 additions and 43 deletions

View File

@ -2,6 +2,7 @@ package repolist
import (
"errors"
"strings"
"go.wit.com/gui"
"go.wit.com/lib/gui/repostatus"
@ -141,10 +142,11 @@ func (r *RepoList) addRepo(grid *gui.Node, path string, master string, devel str
// newRepo.Status.SetDevelWorkingName(devel)
// newRepo.Status.SetUserWorkingName(user)
if strings.HasPrefix(newRepo.GoPath(), "go.wit.com/apps") {
var showBuildB bool = false
switch newRepo.Status.RepoType() {
case "binary":
// log.Info("compile here. Show()")
log.Info("showing compile here button")
showBuildB = true
case "library":
// log.Info("library here. Hide()")
@ -156,6 +158,7 @@ func (r *RepoList) addRepo(grid *gui.Node, path string, master string, devel str
newRepo.Status.Build()
})
}
}
case "guireleaser":
newRepo.targetV = newRepo.Status.MirrorTargetVersion()
grid.Append(newRepo.targetV)

29
new.go
View File

@ -1,29 +0,0 @@
package repolist
import (
"go.wit.com/log"
)
func RemoveFirstElement(slice []string) (string, []string) {
if len(slice) == 0 {
return "", slice // Return the original slice if it's empty
}
return slice[0], slice[1:] // Return the slice without the first element
}
func RepoType() {
for _, repo := range me.allrepos {
switch repo.Status.RepoType() {
case "binary":
//log.Info("compile here. Show()")
repo.Show()
case "library":
//log.Info("library here. Hide()")
repo.Hide()
default:
log.Info("showApps() unknown. Show()")
repo.Hide()
}
}
}