File tree 3 files changed +7
-17
lines changed
3 files changed +7
-17
lines changed Original file line number Diff line number Diff line change @@ -39,11 +39,7 @@ func (s *ContainerBuildOptions) Run(ctx *types.Context) error {
39
39
}
40
40
ctx .BuildOptionsJsonPrevious = buildOptionsJsonPrevious
41
41
42
- commands := []types.Command {
43
- & WipeoutBuildPathIfBuildOptionsChanged {},
44
- & StoreBuildOptionsMap {},
45
- }
46
-
42
+ commands := []types.Command {& WipeoutBuildPathIfBuildOptionsChanged {}}
47
43
for _ , command := range commands {
48
44
PrintRingNameIfDebug (ctx , command )
49
45
err := command .Run (ctx )
@@ -52,5 +48,5 @@ func (s *ContainerBuildOptions) Run(ctx *types.Context) error {
52
48
}
53
49
}
54
50
55
- return nil
51
+ return StoreBuildOptionsMap ( ctx . BuildPath , ctx . BuildOptionsJson )
56
52
}
Original file line number Diff line number Diff line change @@ -17,12 +17,9 @@ package builder
17
17
18
18
import (
19
19
"github.com/arduino/arduino-cli/legacy/builder/constants"
20
- "github.com/arduino/arduino-cli/legacy/builder/types "
20
+ "github.com/arduino/go-paths-helper "
21
21
)
22
22
23
- type StoreBuildOptionsMap struct {}
24
-
25
- func (s * StoreBuildOptionsMap ) Run (ctx * types.Context ) error {
26
- ctx .BuildPath .Join (constants .BUILD_OPTIONS_FILE ).WriteFile ([]byte (ctx .BuildOptionsJson ))
27
- return nil
23
+ func StoreBuildOptionsMap (buildPath * paths.Path , buildOptionsJson string ) error {
24
+ return buildPath .Join (constants .BUILD_OPTIONS_FILE ).WriteFile ([]byte (buildOptionsJson ))
28
25
}
Original file line number Diff line number Diff line change @@ -51,11 +51,8 @@ func TestStoreBuildOptionsMap(t *testing.T) {
51
51
require .NoError (t , err )
52
52
ctx .BuildOptionsJson = buildPropertiesJSON
53
53
54
- commands := []types.Command {& builder.StoreBuildOptionsMap {}}
55
- for _ , command := range commands {
56
- err := command .Run (ctx )
57
- require .NoError (t , err )
58
- }
54
+ err = builder .StoreBuildOptionsMap (ctx .BuildPath , ctx .BuildOptionsJson )
55
+ require .NoError (t , err )
59
56
60
57
exist , err := buildPath .Join (constants .BUILD_OPTIONS_FILE ).ExistCheck ()
61
58
require .NoError (t , err )
You can’t perform that action at this time.
0 commit comments