Browse Source

add new event to auto-updater

Shelley Vohr 7 years ago
parent
commit
06892775d4
2 changed files with 6 additions and 0 deletions
  1. 2 0
      atom/browser/api/atom_api_auto_updater.cc
  2. 4 0
      docs/api/auto-updater.md

+ 2 - 0
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();

+ 4 - 0
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: