Skip to content

Commit 5f73378

Browse files
Add hooks hooks.savehex.presavehex and hooks.savehex.postsavehex (arduino#2091)
1 parent 2f5b767 commit 5f73378

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

commands/compile/compile.go

+10
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,11 @@ func Compile(ctx context.Context, req *rpc.CompileRequest, outStream, errStream
257257
exportBinaries = false
258258
}
259259
if exportBinaries {
260+
presaveHex := builder.RecipeByPrefixSuffixRunner{Prefix: "recipe.hooks.savehex.presavehex", Suffix: ".pattern"}
261+
if err := presaveHex.Run(builderCtx); err != nil {
262+
return r, err
263+
}
264+
260265
var exportPath *paths.Path
261266
if exportDir := req.GetExportDir(); exportDir != "" {
262267
exportPath = paths.New(exportDir)
@@ -290,6 +295,11 @@ func Compile(ctx context.Context, req *rpc.CompileRequest, outStream, errStream
290295
return r, &arduino.PermissionDeniedError{Message: tr("Error copying output file %s", buildFile), Cause: err}
291296
}
292297
}
298+
299+
postsaveHex := builder.RecipeByPrefixSuffixRunner{Prefix: "recipe.hooks.savehex.postsavehex", Suffix: ".pattern"}
300+
if err := postsaveHex.Run(builderCtx); err != nil {
301+
return r, err
302+
}
293303
}
294304

295305
r.ExecutableSectionsSize = builderCtx.ExecutableSectionsSize.ToRPCExecutableSectionSizeArray()

0 commit comments

Comments
 (0)