File tree Expand file tree Collapse file tree 3 files changed +7
-17
lines changed Expand file tree Collapse file tree 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 {
3939 }
4040 ctx .BuildOptionsJsonPrevious = buildOptionsJsonPrevious
4141
42- commands := []types.Command {
43- & WipeoutBuildPathIfBuildOptionsChanged {},
44- & StoreBuildOptionsMap {},
45- }
46-
42+ commands := []types.Command {& WipeoutBuildPathIfBuildOptionsChanged {}}
4743 for _ , command := range commands {
4844 PrintRingNameIfDebug (ctx , command )
4945 err := command .Run (ctx )
@@ -52,5 +48,5 @@ func (s *ContainerBuildOptions) Run(ctx *types.Context) error {
5248 }
5349 }
5450
55- return nil
51+ return StoreBuildOptionsMap ( ctx . BuildPath , ctx . BuildOptionsJson )
5652}
Original file line number Diff line number Diff line change @@ -17,12 +17,9 @@ package builder
1717
1818import (
1919 "github.com/arduino/arduino-cli/legacy/builder/constants"
20- "github.com/arduino/arduino-cli/legacy/builder/types "
20+ "github.com/arduino/go-paths-helper "
2121)
2222
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 ))
2825}
Original file line number Diff line number Diff line change @@ -51,11 +51,8 @@ func TestStoreBuildOptionsMap(t *testing.T) {
5151 require .NoError (t , err )
5252 ctx .BuildOptionsJson = buildPropertiesJSON
5353
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 )
5956
6057 exist , err := buildPath .Join (constants .BUILD_OPTIONS_FILE ).ExistCheck ()
6158 require .NoError (t , err )
You can’t perform that action at this time.
0 commit comments