@@ -154,12 +154,8 @@ func run(cmd *cobra.Command, args []string) {
154
154
} else {
155
155
compileRes , err = compile .Compile (context .Background (), compileReq , os .Stdout , os .Stderr , verboseCompile )
156
156
}
157
- if err != nil {
158
- feedback .Errorf ("Error during build: %v" , err )
159
- os .Exit (errorcodes .ErrGeneric )
160
- }
161
157
162
- if uploadAfterCompile {
158
+ if err == nil && uploadAfterCompile {
163
159
uploadReq := & rpc.UploadReq {
164
160
Instance : inst ,
165
161
Fqbn : fqbn ,
@@ -189,7 +185,12 @@ func run(cmd *cobra.Command, args []string) {
189
185
CompileOut : compileOut .String (),
190
186
CompileErr : compileErr .String (),
191
187
BuilderResult : compileRes ,
188
+ Success : err == nil ,
192
189
})
190
+ if err != nil && output .OutputFormat != "json" {
191
+ feedback .Errorf ("Error during build: %v" , err )
192
+ os .Exit (errorcodes .ErrGeneric )
193
+ }
193
194
}
194
195
195
196
// initSketchPath returns the current working directory
@@ -211,6 +212,7 @@ type compileResult struct {
211
212
CompileOut string `json:"compiler_out"`
212
213
CompileErr string `json:"compiler_err"`
213
214
BuilderResult * rpc.CompileResp `json:"builder_result"`
215
+ Success bool `json:"success"`
214
216
}
215
217
216
218
func (r * compileResult ) Data () interface {} {
0 commit comments