File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ import (
3636 "arduino.cc/builder/utils"
3737 "os"
3838 "path/filepath"
39+ "regexp"
3940)
4041
4142type WipeoutBuildPathIfBuildOptionsChanged struct {}
@@ -44,7 +45,6 @@ func (s *WipeoutBuildPathIfBuildOptionsChanged) Run(context map[string]interface
4445 if ! utils .MapHas (context , constants .CTX_BUILD_OPTIONS_PREVIOUS_JSON ) {
4546 return nil
4647 }
47-
4848 buildOptionsJson := context [constants .CTX_BUILD_OPTIONS_JSON ].(string )
4949 previousBuildOptionsJson := context [constants .CTX_BUILD_OPTIONS_PREVIOUS_JSON ].(string )
5050 logger := context [constants .CTX_LOGGER ].(i18n.Logger )
@@ -53,6 +53,15 @@ func (s *WipeoutBuildPathIfBuildOptionsChanged) Run(context map[string]interface
5353 return nil
5454 }
5555
56+ re := regexp .MustCompile ("(?m)^.*" + constants .CTX_SKETCH_LOCATION + ".*$[\r \n ]+" )
57+ buildOptionsJson = re .ReplaceAllString (buildOptionsJson , "" )
58+ previousBuildOptionsJson = re .ReplaceAllString (previousBuildOptionsJson , "" )
59+
60+ // if the only difference is the sketch path skip deleting everything
61+ if buildOptionsJson == previousBuildOptionsJson {
62+ return nil
63+ }
64+
5665 logger .Println (constants .LOG_LEVEL_INFO , constants .MSG_BUILD_OPTIONS_CHANGED )
5766
5867 buildPath := context [constants .CTX_BUILD_PATH ].(string )
You can’t perform that action at this time.
0 commit comments