packer/plugin: Implement Builder.Cancel

This commit is contained in:
Mitchell Hashimoto 2013-06-03 15:31:28 -07:00
parent e06c26c55c
commit 0ba80c88e8
1 changed files with 6 additions and 0 deletions

View File

@ -32,6 +32,12 @@ func (b *cmdBuilder) Run(ui packer.Ui, hook packer.Hook) packer.Artifact {
}
func (b *cmdBuilder) Cancel() {
defer func() {
r := recover()
b.checkExit(r, nil)
}()
b.builder.Cancel()
}
func (c *cmdBuilder) checkExit(p interface{}, cb func()) {