diff --git a/package.json b/package.json index e0b7fd3..5d21ea9 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "dev": "electron . --dev", "build": "electron-builder", "build-arch": "electron-builder --linux dir", - "release": "electron-builder -mwlp always", + "release": "GH_TOKEN=$(cat GH_TOKEN) electron-builder -wlp always", "test": "echo \"Error: no test specified\" && exit 1" }, "dependencies": { diff --git a/src/main.js b/src/main.js index 69fc574..7ab63f2 100644 --- a/src/main.js +++ b/src/main.js @@ -5,7 +5,7 @@ import {app, BrowserWindow, ipcMain, Menu, shell, Tray} from "electron"; import Meta from "./Meta"; import Config from "./Config"; import Service from "./Service"; -import { autoUpdater } from "electron-updater"; +import {autoUpdater} from "electron-updater"; const resourcesDir = path.resolve(__dirname, '../resources'); const iconPath = path.resolve(resourcesDir, 'logo.png'); @@ -36,11 +36,9 @@ function toggleMainWindow() { } } -function createWindow() { - // Check for updates on windows and mac - if (process.platform === 'win32' || process.platform === 'darwin') { - autoUpdater.checkForUpdatesAndNotify(); - } +async function createWindow() { + // Check for updates + await autoUpdater.checkForUpdatesAndNotify(); // System tray console.log('Loading system Tray'); @@ -229,4 +227,6 @@ function listIcons(set) { } console.log('Starting app'); -app.on('ready', createWindow); +app.on('ready', () => { + createWindow().catch(console.error); +});