Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit fe010cb

Browse filesBrowse files
compile: fix export artifact when contins folder
1 parent 84fc413 commit fe010cb
Copy full SHA for fe010cb

File tree

2 files changed

+33
-0
lines changed
Filter options

2 files changed

+33
-0
lines changed

‎commands/service_compile.go

Copy file name to clipboardExpand all lines: commands/service_compile.go
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,7 @@ func (s *arduinoCoreServerImpl) Compile(req *rpc.CompileRequest, stream rpc.Ardu
404404
return &cmderrors.PermissionDeniedError{Message: i18n.Tr("Error reading build directory"), Cause: err}
405405
}
406406
buildFiles.FilterPrefix(baseName)
407+
buildFiles.FilterOutDirs()
407408
for _, buildFile := range buildFiles {
408409
exportedFile := exportPath.Join(buildFile.Base())
409410
logrus.WithField("src", buildFile).WithField("dest", exportedFile).Trace("Copying artifact.")

‎internal/integrationtest/compile_1/compile_test.go

Copy file name to clipboardExpand all lines: internal/integrationtest/compile_1/compile_test.go
+32Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1321,3 +1321,35 @@ func buildWithCustomBuildPathAndOUtputDirFlag(t *testing.T, env *integrationtest
13211321
require.NotEmpty(t, content)
13221322
}
13231323
}
1324+
1325+
func TestCompileWithOutputDirFlagIgnoringFoldersCreatedByEsp32RainMakerLib(t *testing.T) {
1326+
env, cli := integrationtest.CreateArduinoCLIWithEnvironment(t)
1327+
defer env.CleanUp()
1328+
1329+
_, _, err := cli.Run("update")
1330+
require.NoError(t, err)
1331+
1332+
// Update index with esp32 core and install it
1333+
url := "https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json"
1334+
_, _, err = cli.Run("core", "update-index", "--additional-urls="+url)
1335+
require.NoError(t, err)
1336+
_, _, err = cli.Run("core", "install", "esp32:esp32@3.0.7", "--additional-urls="+url)
1337+
require.NoError(t, err)
1338+
1339+
sketchName := "RainMakerSketch"
1340+
sketchPath := cli.SketchbookDir().Join(sketchName)
1341+
_, _, err = cli.Run("sketch", "new", sketchPath.String())
1342+
require.NoError(t, err)
1343+
1344+
err = sketchPath.Join("RainMakerSketch.ino").WriteFile([]byte(`
1345+
#include "RMaker.h"
1346+
void setup() { }
1347+
void loop() { }`,
1348+
))
1349+
require.NoError(t, err)
1350+
1351+
outputDir := cli.SketchbookDir().Join("test_dir", "output_dir")
1352+
_, stderr, err := cli.Run("compile", "-b", "esp32:esp32:esp32", sketchPath.String(), "--output-dir", outputDir.String())
1353+
require.NoError(t, err)
1354+
require.NotContains(t, stderr, []byte("Error during build: Error copying output file"))
1355+
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.