fix the ENV handling

This commit is contained in:
Jeff Carr 2024-02-26 11:08:28 -06:00
parent cf4a391359
commit 58bde4c39f
2 changed files with 5 additions and 3 deletions

View File

@ -47,11 +47,14 @@ func globalDisplayOptions(vbox *gui.Node) {
me.autoScanReposCB.Custom = func() { me.autoScanReposCB.Custom = func() {
if me.autoScanReposCB.Checked() { if me.autoScanReposCB.Checked() {
os.Setenv("REPO_AUTO_SCAN", "true") os.Setenv("REPO_AUTO_SCAN", "true")
log.Info("env REPO_AUTO_SCAN=", os.Getenv("REPO_AUTO_SCAN"))
} else { } else {
os.Unsetenv("REPO_AUTO_SCAN") os.Unsetenv("REPO_AUTO_SCAN")
log.Info("env REPO_AUTO_SCAN=", os.Getenv("REPO_AUTO_SCAN"))
} }
} }
os.Setenv("REPO_AUTO_SCAN", "true") os.Setenv("REPO_AUTO_SCAN", "true")
scanbox.NewButton("scan now", func() { scanbox.NewButton("scan now", func() {
log.Info("re-scanning repos now") log.Info("re-scanning repos now")
i, s := me.repos.View.ScanRepositories() i, s := me.repos.View.ScanRepositories()

View File

@ -4,7 +4,6 @@ import (
"os" "os"
"go.wit.com/lib/gui/repolist" "go.wit.com/lib/gui/repolist"
"go.wit.com/log"
) )
// like tcl/tk, use ENV variables to set display preferences // like tcl/tk, use ENV variables to set display preferences
@ -18,11 +17,11 @@ func hideFunction(r *repolist.RepoRow) {
// 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() {
log.Info(r.Name(), "hiding read-only repo") // log.Info(r.Name(), "hiding read-only repo")
r.Hide() r.Hide()
return return
} else { } else {
log.Info(r.Name(), "not hiding read-only repo") // log.Info(r.Name(), "not hiding read-only repo")
} }
} }