Skip to content

Commit 91045c6

Browse files
committed
Do not try to export binaries if --only-compilation-database is set
otherwise an empty "build/fqbn/..." folder is created if "always-export-binaries" option is set via config file.
1 parent 0425c95 commit 91045c6

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

commands/compile/compile.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,16 @@ func Compile(ctx context.Context, req *rpc.CompileReq, outStream, errStream io.W
213213
return r, err
214214
}
215215

216+
exportBinaries := req.GetExportBinaries()
216217
// If the export directory is set we assume you want to export the binaries
217-
if req.GetExportBinaries() || req.GetExportDir() != "" {
218+
if req.GetExportDir() != "" {
219+
exportBinaries = true
220+
}
221+
// If CreateCompilationDatabaseOnly is set, we do not need to export anything
222+
if req.GetCreateCompilationDatabaseOnly() {
223+
exportBinaries = false
224+
}
225+
if exportBinaries {
218226
var exportPath *paths.Path
219227
if exportDir := req.GetExportDir(); exportDir != "" {
220228
exportPath = paths.New(exportDir)

0 commit comments

Comments
 (0)