Skip to content

Commit

Permalink
feat: enable auto update
Browse files Browse the repository at this point in the history
closes #24
  • Loading branch information
juancarlosfarah committed Apr 29, 2019
1 parent 3353eee commit b053ceb
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 8 deletions.
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ jspm_packages
.DS_Store
.env.*
env*
.env*

# include encrypted environment variables
!.env*.encrypted
Expand Down Expand Up @@ -53,5 +54,8 @@ build/*
# exclude keys
*.aes

# exclude provision profile
# exclude provision profiles
/assets/*.provisionprofile

# exclude tarballs
*.tgz
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@
"start": "concurrently \"cross-env BROWSER=none yarn react-scripts start\" \"wait-on http://localhost:3000 && electron .\"",
"pack": "electron-builder --dir",
"postinstall": "electron-builder install-app-deps",
"dist": "env-cmd ./.env.prod electron-builder",
"release": "env-cmd ./.env.prod build"
"predist": "yarn build",
"dist": "env-cmd ./.env electron-builder",
"release": "env-cmd ./.env build"
},
"dependencies": {
"@material-ui/core": "3.9.3",
Expand Down
21 changes: 16 additions & 5 deletions public/electron.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const { download } = electronDl;
const extract = require('extract-zip');
const archiver = require('archiver');
const { ncp } = require('ncp');
const { autoUpdater } = require("electron-updater");
const {
DELETE_SPACE_CHANNEL,
DELETED_SPACE_CHANNEL,
Expand Down Expand Up @@ -100,11 +101,20 @@ generateMenu = () => {
const template = [
{
label: 'File',
submenu: [{
label: 'Load Space',
click() { this.handleLoad() }},
{ role: 'about' },
{ role: 'quit' }],
submenu: [
{
label: 'Load Space',
click() { this.handleLoad() }
},
{
label: 'About',
role: 'about',
},
{
label: 'Quit',
role: 'quit',
}
],
},
{type:'separator'},
{
Expand Down Expand Up @@ -167,6 +177,7 @@ generateMenu = () => {
};

app.on('ready', () => {
autoUpdater.checkForUpdatesAndNotify();
createWindow();
generateMenu();
ipcMain.on(GET_SPACE_CHANNEL, async (event, { id, spaces }) => {
Expand Down

0 comments on commit b053ceb

Please sign in to comment.