fix: do not display warning if post action/shell not used

This commit is contained in:
Wendell Sun 2021-10-29 14:13:54 +08:00
parent 3613a2039d
commit 7c17403ec5

View file

@ -345,8 +345,17 @@ func Compile(ctx context.Context, targets []string) error {
return err return err
} }
} else { } else {
displayWarn := false
for _, configItem := range configItems {
if len(configItem.Config().PostActions) > 0 || configItem.Config().PostShell != "" {
displayWarn = true
break
}
}
if displayWarn {
log.LogWarn(nil, "PostAction and PostShell is skipped. If you need to allow execution, please append '-p' to command flags to enable") log.LogWarn(nil, "PostAction and PostShell is skipped. If you need to allow execution, please append '-p' to command flags to enable")
} }
}
log.LogInfo(nil, "Good job! you are ready to go :)") log.LogInfo(nil, "Good job! you are ready to go :)")
return nil return nil