fix the ENV handling
This commit is contained in:
parent
cf4a391359
commit
58bde4c39f
|
@ -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()
|
||||||
|
|
|
@ -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")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue