File tree 1 file changed +10
-1
lines changed
1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ import (
36
36
"arduino.cc/builder/utils"
37
37
"os"
38
38
"path/filepath"
39
+ "regexp"
39
40
)
40
41
41
42
type WipeoutBuildPathIfBuildOptionsChanged struct {}
@@ -44,7 +45,6 @@ func (s *WipeoutBuildPathIfBuildOptionsChanged) Run(context map[string]interface
44
45
if ! utils .MapHas (context , constants .CTX_BUILD_OPTIONS_PREVIOUS_JSON ) {
45
46
return nil
46
47
}
47
-
48
48
buildOptionsJson := context [constants .CTX_BUILD_OPTIONS_JSON ].(string )
49
49
previousBuildOptionsJson := context [constants .CTX_BUILD_OPTIONS_PREVIOUS_JSON ].(string )
50
50
logger := context [constants .CTX_LOGGER ].(i18n.Logger )
@@ -53,6 +53,15 @@ func (s *WipeoutBuildPathIfBuildOptionsChanged) Run(context map[string]interface
53
53
return nil
54
54
}
55
55
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
+
56
65
logger .Println (constants .LOG_LEVEL_INFO , constants .MSG_BUILD_OPTIONS_CHANGED )
57
66
58
67
buildPath := context [constants .CTX_BUILD_PATH ].(string )
You can’t perform that action at this time.
0 commit comments