Skip to content

Commit 25c85cb

Browse files
masciMassimiliano Pippi
authored andcommitted
do not expect binary artifacts when preprocess or show-properties
1 parent 5858721 commit 25c85cb

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

commands/compile/compile.go

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -158,18 +158,16 @@ func Compile(ctx context.Context, req *rpc.CompileReq, outStream, errStream io.W
158158
builderCtx.ExecStdout = outStream
159159
builderCtx.ExecStderr = errStream
160160
builderCtx.SetLogger(i18n.LoggerToCustomStreams{Stdout: outStream, Stderr: errStream})
161+
162+
// if --preprocess or --show-properties were passed, we can stop here
161163
if req.GetShowProperties() {
162-
err = builder.RunParseHardwareAndDumpBuildProperties(builderCtx)
164+
return &rpc.CompileResp{}, builder.RunParseHardwareAndDumpBuildProperties(builderCtx)
163165
} else if req.GetPreprocess() {
164-
if err = builder.RunPreprocess(builderCtx); err != nil {
165-
return nil, fmt.Errorf("preprocessing sketch: %s", err)
166-
}
167-
return &rpc.CompileResp{}, nil
168-
} else {
169-
err = builder.RunBuilder(builderCtx)
166+
return &rpc.CompileResp{}, builder.RunPreprocess(builderCtx)
170167
}
171168

172-
if err != nil {
169+
// if it's a regular build, go on...
170+
if err := builder.RunBuilder(builderCtx); err != nil {
173171
return nil, fmt.Errorf("build failed: %s", err)
174172
}
175173

0 commit comments

Comments
 (0)