diff --git a/packer/plugin/plugin.go b/packer/plugin/plugin.go index 48da97445..f9fca8cdd 100644 --- a/packer/plugin/plugin.go +++ b/packer/plugin/plugin.go @@ -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 +}