Unverified Commit 5f733780 authored by MatteoPologruto's avatar MatteoPologruto Committed by GitHub

Add hooks `hooks.savehex.presavehex` and `hooks.savehex.postsavehex` (#2091)

parent 2f5b7678
......@@ -257,6 +257,11 @@ func Compile(ctx context.Context, req *rpc.CompileRequest, outStream, errStream
exportBinaries = false
}
if exportBinaries {
presaveHex := builder.RecipeByPrefixSuffixRunner{Prefix: "recipe.hooks.savehex.presavehex", Suffix: ".pattern"}
if err := presaveHex.Run(builderCtx); err != nil {
return r, err
}
var exportPath *paths.Path
if exportDir := req.GetExportDir(); exportDir != "" {
exportPath = paths.New(exportDir)
......@@ -290,6 +295,11 @@ func Compile(ctx context.Context, req *rpc.CompileRequest, outStream, errStream
return r, &arduino.PermissionDeniedError{Message: tr("Error copying output file %s", buildFile), Cause: err}
}
}
postsaveHex := builder.RecipeByPrefixSuffixRunner{Prefix: "recipe.hooks.savehex.postsavehex", Suffix: ".pattern"}
if err := postsaveHex.Run(builderCtx); err != nil {
return r, err
}
}
r.ExecutableSectionsSize = builderCtx.ExecutableSectionsSize.ToRPCExecutableSectionSizeArray()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment