diff --git a/pkg/cli/cli_impl.go b/pkg/cli/cli_impl.go index 8e292cc315b..660e9beeba5 100644 --- a/pkg/cli/cli_impl.go +++ b/pkg/cli/cli_impl.go @@ -1141,12 +1141,13 @@ func runImpl(osArgs []string) int { osArgs, analyze := filterAnalyzeFlags(osArgs) buildOptions, transformOptions, extras, err := parseOptionsForRun(osArgs) - if analyze != analyzeDisabled { - addAnalyzePlugin(buildOptions, analyze, osArgs) - } switch { case buildOptions != nil: + if analyze != analyzeDisabled { + addAnalyzePlugin(buildOptions, analyze, osArgs) + } + // Read the "NODE_PATH" from the environment. This is part of node's // module resolution algorithm. Documentation for this can be found here: // https://nodejs.org/api/modules.html#modules_loading_from_the_global_folders @@ -1322,6 +1323,10 @@ func runImpl(osArgs []string) int { } case transformOptions != nil: + if analyze != analyzeDisabled { + logger.PrintErrorWithNoteToStderr(osArgs, "--analyze not supported while transforming", "") + return 1 + } // Read the input from stdin bytes, err := ioutil.ReadAll(os.Stdin) if err != nil {