feat: added Init() and Cleanup() in hooks
This commit is contained in:
parent
bdd85b01ff
commit
277de43a02
2 changed files with 24 additions and 0 deletions
|
|
@ -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]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue