packer/plugin: Interrupted() to check for i nterrupts

This commit is contained in:
Mitchell Hashimoto 2013-08-30 16:39:28 -07:00
parent 55b0b586d3
commit d5c6b9fad3
1 changed files with 5 additions and 0 deletions

View File

@ -177,3 +177,8 @@ func ServeProvisioner(p packer.Provisioner) {
os.Exit(1)
}
}
// Tests whether or not the plugin was interrupted or not.
func Interrupted() bool {
return atomic.LoadInt32(&Interrupts) > 0
}