From 06892775d4013429c3e36b944317a5dc3ccfce68 Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Sat, 14 Apr 2018 21:29:36 -0400 Subject: [PATCH] add new event to auto-updater --- atom/browser/api/atom_api_auto_updater.cc | 2 ++ docs/api/auto-updater.md | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/atom/browser/api/atom_api_auto_updater.cc b/atom/browser/api/atom_api_auto_updater.cc index 88a58f6bca6b..5d736ad43d7b 100644 --- a/atom/browser/api/atom_api_auto_updater.cc +++ b/atom/browser/api/atom_api_auto_updater.cc @@ -104,6 +104,8 @@ void AutoUpdater::SetFeedURL(mate::Arguments* args) { } void AutoUpdater::QuitAndInstall() { + Emit("before-quit-for-update"); + // If we don't have any window then quitAndInstall immediately. if (WindowList::IsEmpty()) { auto_updater::AutoUpdater::QuitAndInstall(); diff --git a/docs/api/auto-updater.md b/docs/api/auto-updater.md index 6d9b4d2c7cc1..2466494208dc 100644 --- a/docs/api/auto-updater.md +++ b/docs/api/auto-updater.md @@ -84,6 +84,10 @@ Emitted when an update has been downloaded. On Windows only `releaseName` is available. +### Event: 'before-quit-for-update' + +Emitted when `quitAndInstall()` is called. + ## Methods The `autoUpdater` object has the following methods: