packer/plugin: Properly supports Artifacts

This commit is contained in:
Mitchell Hashimoto 2013-05-21 22:16:26 -07:00
parent caa2b7711b
commit e9618b0d07
2 changed files with 5 additions and 3 deletions

View File

@ -22,13 +22,13 @@ func (b *cmdBuilder) Prepare(config interface{}) error {
return b.builder.Prepare(config)
}
func (b *cmdBuilder) Run(ui packer.Ui, hook packer.Hook) {
func (b *cmdBuilder) Run(ui packer.Ui, hook packer.Hook) packer.Artifact {
defer func() {
r := recover()
b.checkExit(r, nil)
}()
b.builder.Run(ui, hook)
return b.builder.Run(ui, hook)
}
func (c *cmdBuilder) checkExit(p interface{}, cb func()) {

View File

@ -13,7 +13,9 @@ func (helperBuilder) Prepare(interface{}) error {
return nil
}
func (helperBuilder) Run(packer.Ui, packer.Hook) {}
func (helperBuilder) Run(packer.Ui, packer.Hook) packer.Artifact {
return nil
}
func TestBuilder_NoExist(t *testing.T) {
assert := asserts.NewTestingAsserts(t, true)