Skip to content

Commit

Permalink
Do not abort build if loading errors happens for not compiled platfor…
Browse files Browse the repository at this point in the history
…ms (#1606)

This is mostly useful for "arduino-builder".
  • Loading branch information
cmaglie committed Jan 3, 2022
1 parent 4506bf9 commit 60c1c98
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions legacy/builder/hardware_loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ package builder
import (
"github.com/arduino/arduino-cli/arduino/cores/packagemanager"
"github.com/arduino/arduino-cli/legacy/builder/types"
"github.com/pkg/errors"
)

type HardwareLoader struct{}
Expand All @@ -33,7 +32,13 @@ func (s *HardwareLoader) Run(ctx *types.Context) error {
// I have no intention right now to start a refactoring of the legacy package too, so
// here's this shitty solution for now.
// When we're gonna refactor the legacy package this will be gone.
return errors.WithStack(errs[0].Err())

if ctx.Verbose {
log := ctx.GetLogger()
for _, err := range errs {
log.Println("info", "Error loading hardware platform: {0}", err.Message())
}
}
}
ctx.PackageManager = pm
}
Expand Down

0 comments on commit 60c1c98

Please sign in to comment.