guireleaser works again

This commit is contained in:
Jeff Carr 2024-02-29 19:51:28 -06:00
parent 2c1cd3343b
commit 5aa110ae8b
2 changed files with 18 additions and 25 deletions

View File

@ -27,10 +27,14 @@ func globalDisplayOptions(box *gui.Node) {
hidegrid.NextRow() hidegrid.NextRow()
me.autoHideReadOnly = hidegrid.NewCheckbox("Hide read-only repos").SetChecked(true) me.autoHideReadOnly = hidegrid.NewCheckbox("Hide read-only repos").SetChecked(true)
// me.autoHideReadOnly.Custom = func() { me.autoHideReadOnly.Custom = func() {
// log.Info("registered hide function to globalDisplayShow()") if me.autoHideReadOnly.Checked() {
// me.repos.View.RegisterHideFunction(globalDisplayShow) os.Setenv("AUTOTYPIST_READONLY", "hide")
// } } else {
os.Unsetenv("AUTOTYPIST_READONLY")
}
}
os.Setenv("AUTOTYPIST_READONLY", "hide")
hidegrid.NextRow() hidegrid.NextRow()
me.autoHideReleased = hidegrid.NewCheckbox("Hide Released repos").SetChecked(true) me.autoHideReleased = hidegrid.NewCheckbox("Hide Released repos").SetChecked(true)

View File

@ -20,6 +20,12 @@ func hideFunction(r *repolist.RepoRow) {
return return
} }
// always show repos that have not been merged ?
if r.GoState() == "merge to devel" {
r.Show()
return
}
// hide read-only repos // hide read-only repos
if os.Getenv("AUTOTYPIST_READONLY") == "hide" { if os.Getenv("AUTOTYPIST_READONLY") == "hide" {
if r.Status.ReadOnly() { if r.Status.ReadOnly() {
@ -41,9 +47,8 @@ func hideFunction(r *repolist.RepoRow) {
} }
} }
// hide perfectly clean repos if me.autoHideReleased.Checked() {
if os.Getenv("AUTOTYPIST_CLEAN") == "hide" { if r.Status.IsReleased() {
if r.IsPerfect() {
r.Hide() r.Hide()
return return
} }
@ -55,30 +60,13 @@ func hideFunction(r *repolist.RepoRow) {
r.Show() r.Show()
} }
/*
func showHideRepos(repo *repolist.RepoRow) { func showHideRepos(repo *repolist.RepoRow) {
if repo.GoPath() == "go.wit.com/dev/alexflint/arg" { if repo.GoPath() == "go.wit.com/dev/alexflint/arg" {
log.Info("found autoHideReleased() =", me.autoHideReleased.Checked()) log.Info("found autoHideReleased() =", me.autoHideReleased.Checked())
log.Info("found alexflint/arg IsReleased() =", repo.Status.IsReleased()) log.Info("found alexflint/arg IsReleased() =", repo.Status.IsReleased())
} }
// always show dirty repos
if repo.IsDirty() {
repo.Show()
return
}
// always show repos that have not been merged ?
if repo.GoState() == "merge to devel" {
repo.Show()
return
}
// hide read-only repos. These are repos that do not
// match things in the users config file (.config/autotypist)
if me.autoHideReadOnly.Checked() {
if repo.Status.ReadOnly() {
repo.Hide()
return
}
}
if me.autoHideReleased.Checked() { if me.autoHideReleased.Checked() {
if repo.Status.IsReleased() { if repo.Status.IsReleased() {
repo.Hide() repo.Hide()
@ -87,3 +75,4 @@ func showHideRepos(repo *repolist.RepoRow) {
} }
repo.Show() repo.Show()
} }
*/