trying to debug ENV settings

This commit is contained in:
Jeff Carr 2024-02-25 18:37:03 -06:00
parent 6286dd12e3
commit cf4a391359
2 changed files with 7 additions and 0 deletions

View File

@ -30,6 +30,7 @@ func globalDisplayOptions(vbox *gui.Node) {
os.Unsetenv("AUTOTYPIST_READONLY")
}
}
os.Setenv("AUTOTYPIST_READONLY", "hide")
me.autoHidePerfect = group1.NewCheckbox("Hide Perfectly clean repos").SetChecked(true)
me.autoHidePerfect.Custom = func() {
@ -39,6 +40,8 @@ func globalDisplayOptions(vbox *gui.Node) {
os.Unsetenv("AUTOTYPIST_CLEAN")
}
}
os.Setenv("AUTOTYPIST_CLEAN", "hide")
scanbox := group1.Box().Horizontal()
me.autoScanReposCB = scanbox.NewCheckbox("auto scan").SetChecked(true)
me.autoScanReposCB.Custom = func() {

View File

@ -4,6 +4,7 @@ import (
"os"
"go.wit.com/lib/gui/repolist"
"go.wit.com/log"
)
// like tcl/tk, use ENV variables to set display preferences
@ -17,8 +18,11 @@ func hideFunction(r *repolist.RepoRow) {
// hide read-only repos
if os.Getenv("AUTOTYPIST_READONLY") == "hide" {
if r.Status.ReadOnly() {
log.Info(r.Name(), "hiding read-only repo")
r.Hide()
return
} else {
log.Info(r.Name(), "not hiding read-only repo")
}
}