Skip to content
This repository has been archived by the owner on Jul 12, 2021. It is now read-only.

Commit

Permalink
Add auto updater
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelmeuli committed Dec 13, 2018
1 parent afe9342 commit 317cf63
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 6 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"elasticlunr": "^0.9.5",
"electron-debug": "^2.0.0",
"electron-settings": "^3.2.0",
"electron-updater": "^4.0.6",
"feather-icons": "^4.9.0",
"lodash.debounce": "^4.0.8",
"minireset.css": "^0.0.3",
Expand Down
13 changes: 9 additions & 4 deletions src/main.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const { app, BrowserWindow } = require('electron');
require('electron-debug')();
const { autoUpdater } = require('electron-updater');

const { getWindow, setWindow } = require('./main/window');

Expand Down Expand Up @@ -29,18 +30,22 @@ function createMainWindow() {
return window;
}

function run() {
const window = createMainWindow();
setWindow(window);
autoUpdater.checkForUpdatesAndNotify();
}

app.on('window-all-closed', () => {
app.quit();
});

app.on('activate', () => {
if (!getWindow()) {
const window = createMainWindow();
setWindow(window);
run();
}
});

app.on('ready', () => {
const window = createMainWindow();
setWindow(window);
run();
});
24 changes: 22 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1443,7 +1443,7 @@ buffer@^4.3.0:
ieee754 "^1.1.4"
isarray "^1.0.0"

[email protected], builder-util-runtime@^8.0.2, builder-util-runtime@^8.1.0:
[email protected], builder-util-runtime@^8.0.2, builder-util-runtime@^8.1.0, builder-util-runtime@~8.1.0:
version "8.1.0"
resolved "https://registry.yarnpkg.com/builder-util-runtime/-/builder-util-runtime-8.1.0.tgz#dd7fca995d48ceee7580b4851ca057566c94601e"
integrity sha512-s1mlJ28mv+56Iebh6c9aXjVe11O3Z0cDTwAGeB0PCcUzHA37fDxGgS8ZGoYNMZP+rBHj21d/od1wuYofTVLaQg==
Expand Down Expand Up @@ -2640,6 +2640,21 @@ electron-to-chromium@^1.2.7, electron-to-chromium@^1.3.86:
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.90.tgz#b4c51b8303beff18f2b74817402bf4898e09558a"
integrity sha512-IjJZKRhFbWSOX1w0sdIXgp4CMRguu6UYcTckyFF/Gjtemsu/25eZ+RXwFlV+UWcIueHyQA1UnRJxocTpH5NdGA==

electron-updater@^4.0.6:
version "4.0.6"
resolved "https://registry.yarnpkg.com/electron-updater/-/electron-updater-4.0.6.tgz#9c4f495ae0e80bf4425e3e1b801c5ed2ab933c2d"
integrity sha512-JPGLME6fxJcHG8hX7HWFl6Aew6iVm0DkcrENreKa5SUJCHG+uUaAhxDGDt+YGcNkyx1uJ6eBGMvFxDTLUv67pg==
dependencies:
bluebird-lst "^1.0.6"
builder-util-runtime "~8.1.0"
fs-extra-p "^7.0.0"
js-yaml "^3.12.0"
lazy-val "^1.0.3"
lodash.isequal "^4.5.0"
pako "^1.0.7"
semver "^5.6.0"
source-map-support "^0.5.9"

electron@^3.0.2:
version "3.0.11"
resolved "https://registry.yarnpkg.com/electron/-/electron-3.0.11.tgz#81e350db741fc0f2997ecb2fef5ed085ca42a723"
Expand Down Expand Up @@ -4656,6 +4671,11 @@ lodash.debounce@^4.0.8:
resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af"
integrity sha1-gteb/zCmfEAF/9XiUVMArZyk168=

lodash.isequal@^4.5.0:
version "4.5.0"
resolved "https://registry.yarnpkg.com/lodash.isequal/-/lodash.isequal-4.5.0.tgz#415c4478f2bcc30120c22ce10ed3226f7d3e18e0"
integrity sha1-QVxEePK8wwEgwizhDtMib30+GOA=

lodash.mergewith@^4.6.0:
version "4.6.1"
resolved "https://registry.yarnpkg.com/lodash.mergewith/-/lodash.mergewith-4.6.1.tgz#639057e726c3afbdb3e7d42741caa8d6e4335927"
Expand Down Expand Up @@ -5555,7 +5575,7 @@ package-json@^4.0.0:
registry-url "^3.0.3"
semver "^5.1.0"

pako@~1.0.5:
pako@^1.0.7, pako@~1.0.5:
version "1.0.7"
resolved "https://registry.yarnpkg.com/pako/-/pako-1.0.7.tgz#2473439021b57f1516c82f58be7275ad8ef1bb27"
integrity sha512-3HNK5tW4x8o5mO8RuHZp3Ydw9icZXx0RANAOMzlMzx7LVXhMJ4mo3MOBpzyd7r/+RUu8BmndP47LXT+vzjtWcQ==
Expand Down

0 comments on commit 317cf63

Please sign in to comment.