only check for build button on a go.wit.com/apps
This commit is contained in:
parent
abd6ace49e
commit
1a3ac68730
31
addRepo.go
31
addRepo.go
|
@ -2,6 +2,7 @@ package repolist
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"go.wit.com/gui"
|
"go.wit.com/gui"
|
||||||
"go.wit.com/lib/gui/repostatus"
|
"go.wit.com/lib/gui/repostatus"
|
||||||
|
@ -141,20 +142,22 @@ func (r *RepoList) addRepo(grid *gui.Node, path string, master string, devel str
|
||||||
// newRepo.Status.SetDevelWorkingName(devel)
|
// newRepo.Status.SetDevelWorkingName(devel)
|
||||||
// newRepo.Status.SetUserWorkingName(user)
|
// newRepo.Status.SetUserWorkingName(user)
|
||||||
|
|
||||||
var showBuildB bool = false
|
if strings.HasPrefix(newRepo.GoPath(), "go.wit.com/apps") {
|
||||||
switch newRepo.Status.RepoType() {
|
var showBuildB bool = false
|
||||||
case "binary":
|
switch newRepo.Status.RepoType() {
|
||||||
// log.Info("compile here. Show()")
|
case "binary":
|
||||||
showBuildB = true
|
log.Info("showing compile here button")
|
||||||
case "library":
|
showBuildB = true
|
||||||
// log.Info("library here. Hide()")
|
case "library":
|
||||||
default:
|
// log.Info("library here. Hide()")
|
||||||
// log.Info("unknown RepoType", newRepo.Status.RepoType())
|
default:
|
||||||
}
|
// log.Info("unknown RepoType", newRepo.Status.RepoType())
|
||||||
if showBuildB {
|
}
|
||||||
newRepo.endBox.NewButton("build", func() {
|
if showBuildB {
|
||||||
newRepo.Status.Build()
|
newRepo.endBox.NewButton("build", func() {
|
||||||
})
|
newRepo.Status.Build()
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
case "guireleaser":
|
case "guireleaser":
|
||||||
newRepo.targetV = newRepo.Status.MirrorTargetVersion()
|
newRepo.targetV = newRepo.Status.MirrorTargetVersion()
|
||||||
|
|
29
new.go
29
new.go
|
@ -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()
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue