Skip to content
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
7 changes: 7 additions & 0 deletions commands/service_upload.go
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,8 @@ func (s *arduinoCoreServerImpl) runProgramAction(ctx context.Context, pme *packa
}
}

preUpload := uploadProperties.GetBoolean("upload.use_pre_upload_check")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

upload.use_pre_upload_check seems superfluous. Why not just use the existence of the pattern properties as the determining factor?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That could be an idea 🙂 I just eanted to keep theat part more isolated but it's indeed superfluous.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought about this a bit and I think it might be better to keep some kind of board-depenedant flag (coming from boards.txt) otherwise the rule will apply to all the boards using the same upload tool (and it might be unwanted for some reason)


// Run recipes for upload
toolEnv := pme.GetEnvVarsForSpawnedProcess()
if burnBootloader {
Expand All @@ -585,6 +587,11 @@ func (s *arduinoCoreServerImpl) runProgramAction(ctx context.Context, pme *packa
return nil, &cmderrors.FailedUploadError{Message: i18n.Tr("Failed programming"), Cause: err}
}
} else {
if preUpload && (runTool(uploadCtx, "pre_upload_check.pattern", uploadProperties, outStream, errStream, verbose, dryRun, toolEnv) != nil) {
if err := runTool(uploadCtx, "pre_upload.pattern", uploadProperties, outStream, errStream, verbose, dryRun, toolEnv); err != nil {
return nil, &cmderrors.FailedUploadError{Message: i18n.Tr("Failed uploading"), Cause: err}
}
}
if err := runTool(uploadCtx, "upload.pattern", uploadProperties, outStream, errStream, verbose, dryRun, toolEnv); err != nil {
return nil, &cmderrors.FailedUploadError{Message: i18n.Tr("Failed uploading"), Cause: err}
}
Expand Down
Loading