autoUpdater.ts 639 B

12345678910111213141516171819
  1. // Copyright 2017-2020 @polkadot/apps authors & contributors
  2. // This software may be modified and distributed under the terms
  3. // of the Apache-2.0 license. See the LICENSE file for details.
  4. import { AppUpdater } from 'electron-updater';
  5. export async function setupAutoUpdater (): Promise<void> {
  6. const { autoUpdater } = await import('electron-updater');
  7. await setLogger(autoUpdater);
  8. autoUpdater.checkForUpdatesAndNotify().catch(console.error);
  9. }
  10. async function setLogger (autoUpdater: AppUpdater): Promise<void> {
  11. const log = await import('electron-log');
  12. log.transports.file.level = 'debug';
  13. autoUpdater.logger = log;
  14. }