8000 check whether prevOpts is nil in WipeoutBuildPathIfBuildOptionsChanged's Run by d-a-v · Pull Request #1118 · arduino/arduino-cli · GitHub
[go: up one dir, main page]

Skip to content

check whether prevOpts is nil in WipeoutBuildPathIfBuildOptionsChanged's Run #1118

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 8 commits into from
May 10, 2021
Merged
Changes from 1 commit
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
Next Next commit
check whether prevOpts is nil in WipeoutBuildPathIfBuildOptionsChange…
…d's Run
  • Loading branch information
d-a-v authored and silvanocerza committed May 10, 2021
commit bbf3a431fac3bb7247b6fcc2473a6204a7276981
4 changes: 2 additions & 2 deletions legacy/builder/wipeout_build_path_if_build_options_changed.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ func (s *WipeoutBuildPathIfBuildOptionsChanged) Run(ctx *types.Context) error {
json.Unmarshal([]byte(previousBuildOptionsJson), &prevOpts)

// If SketchLocation path is different but filename is the same, consider it equal
if filepath.Base(opts.Get("sketchLocation")) == filepath.Base(prevOpts.Get("sketchLocation")) {
if prevOpts != nil && filepath.Base(opts.Get("sketchLocation")) == filepath.Base(prevOpts.Get("sketchLocation")) {
opts.Remove("sketchLocation")
prevOpts.Remove("sketchLocation")
}

// If options are not changed check if core has
if opts.Equals(prevOpts) {
if prevOpts != nil && opts.Equals(prevOpts) {
// check if any of the files contained in the core folders has changed
// since the json was generated - like platform.txt or similar
// if so, trigger a "safety" wipe
Expand Down
0