File tree 1 file changed +10
-6
lines changed
1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ import (
37
37
"os"
38
38
"path/filepath"
39
39
"regexp"
40
+ "strings"
40
41
)
41
42
42
43
type WipeoutBuildPathIfBuildOptionsChanged struct {}
@@ -53,13 +54,16 @@ func (s *WipeoutBuildPathIfBuildOptionsChanged) Run(context map[string]interface
53
54
return nil
54
55
}
55
56
56
- re := regexp .MustCompile ("(?m)^.*" + constants .CTX_SKETCH_LOCATION + ".*$[\r \n ]+" )
57
- buildOptionsJson = re .ReplaceAllString (buildOptionsJson , "" )
58
- previousBuildOptionsJson = re .ReplaceAllString (previousBuildOptionsJson , "" )
57
+ sketchName := filepath .Base (context [constants .CTX_SKETCH_LOCATION ].(string ))
58
+ if (strings .Contains (previousBuildOptionsJson , sketchName )) {
59
+ re := regexp .MustCompile ("(?m)^.*" + constants .CTX_SKETCH_LOCATION + ".*$[\r \n ]+" )
60
+ buildOptionsJson = re .ReplaceAllString (buildOptionsJson , "" )
61
+ previousBuildOptionsJson = re .ReplaceAllString (previousBuildOptionsJson , "" )
59
62
60
- // if the only difference is the sketch path skip deleting everything
61
- if buildOptionsJson == previousBuildOptionsJson {
62
- return nil
63
+ // if the only difference is the sketch path skip deleting everything
64
+ if buildOptionsJson == previousBuildOptionsJson {
65
+ return nil
66
+ }
63
67
}
64
68
65
69
logger .Println (constants .LOG_LEVEL_INFO , constants .MSG_BUILD_OPTIONS_CHANGED )
You can’t perform that action at this time.
0 commit comments