fix(debug): init CmdFlags correctly

relates #2238
This commit is contained in:
Jan De Dobbeleer 2022-05-08 08:17:48 +02:00 committed by Jan De Dobbeleer
parent e001534088
commit a940a109df

View file

@ -229,12 +229,12 @@ type ShellEnvironment struct {
func (env *ShellEnvironment) Init() {
defer env.Trace(time.Now(), "Init")
if env.CmdFlags.Debug {
log.SetOutput(&env.logBuilder)
}
if env.CmdFlags == nil {
env.CmdFlags = &Flags{}
}
if env.CmdFlags.Debug {
log.SetOutput(&env.logBuilder)
}
env.fileCache = &fileCache{}
env.fileCache.Init(env.CachePath())
env.resolveConfigPath()