Skip to content

Do not bail out if compile_commands.json is empty #58

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

Merged
merged 1 commit into from
Jan 28, 2021
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion handler/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,12 @@ func (handler *InoHandler) generateBuildEnvironment() (*paths.Path, error) {
CompilerOut string `json:"compiler_out"`
CompilerErr string `json:"compiler_err"`
BuilderResult cmdBuilderRes `json:"builder_result"`
Success bool `json:"success"`
}
var res cmdRes
if err := json.Unmarshal(cmdOutput.Bytes(), &res); err != nil {
return nil, errors.Errorf("parsing arduino-cli output: %s", err)
}

// Return only the build path
log.Println("arduino-cli output:", cmdOutput)
return res.BuilderResult.BuildPath, nil
Expand Down
4 changes: 1 addition & 3 deletions handler/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -691,9 +691,7 @@ func examineCompileCommandsJSON(compileCommandsDir *paths.Path) map[string]bool

compilers[compiler] = true
}
if len(compilers) == 0 {
panic("main compiler not found")
}

// Save back compile_commands.json with OS native file separator and extension
compileCommands.SaveToFile()

Expand Down