From 7c17403ec528b826ad938020ccdb9c12c7d3494b Mon Sep 17 00:00:00 2001 From: Wendell Sun Date: Fri, 29 Oct 2021 14:13:54 +0800 Subject: [PATCH] fix: do not display warning if post action/shell not used --- pkg/bootstraps/build.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pkg/bootstraps/build.go b/pkg/bootstraps/build.go index dd421cb..c4c8675 100644 --- a/pkg/bootstraps/build.go +++ b/pkg/bootstraps/build.go @@ -345,7 +345,16 @@ func Compile(ctx context.Context, targets []string) error { return err } } else { - log.LogWarn(nil, "PostAction and PostShell is skipped. If you need to allow execution, please append '-p' to command flags to enable") + 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.LogInfo(nil, "Good job! you are ready to go :)")