feat: added Init() and Cleanup() in hooks

This commit is contained in:
David Allen 2025-08-31 22:04:02 -06:00
parent bdd85b01ff
commit 277de43a02
Signed by: towk
GPG key ID: 0430CDBE22619155
2 changed files with 24 additions and 0 deletions

View file

@ -133,10 +133,18 @@ func addToArchive(tw *tar.Writer, filename string, hooks []makeshift.Hook) error
}
hook.Data.Set("file", contents)
err = hook.Init()
if err != nil {
return err
}
err = hook.Run()
if err != nil {
return err
}
err = hook.Cleanup()
if err != nil {
return err
}
// create temporary file to use to add to archive
hook = hooks[len(hooks)-1]