Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't add analyze plugin when buildOptions == nil #3373

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions pkg/cli/cli_impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 {
Expand Down