refactor: add more logging for environment

relates to #4066
This commit is contained in:
Jan De Dobbeleer 2023-07-19 08:31:15 +02:00 committed by Jan De Dobbeleer
parent d4d6710fab
commit 5f8ae8094f

View file

@ -771,14 +771,14 @@ func (env *Shell) LoadTemplateCache() {
if !OK {
return
}
var templateCache TemplateCache
err := json.Unmarshal([]byte(val), &templateCache)
var tmplCache TemplateCache
err := json.Unmarshal([]byte(val), &tmplCache)
if err != nil {
env.Error(err)
return
}
templateCache.initialized = true
env.tmplCache = &templateCache
tmplCache.initialized = true
env.tmplCache = &tmplCache
}
func (env *Shell) Logs() string {
@ -811,6 +811,7 @@ func (env *Shell) TemplateCache() *TemplateCache {
const separator = "="
values := os.Environ()
env.DebugF("environment: %v", values)
for value := range values {
key, val, valid := strings.Cut(values[value], separator)
if !valid {