This repository has been archived by the owner on Apr 21, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
2,202 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
node_modules/ | ||
storage/*.json | ||
dist/ | ||
config.json | ||
*.sublime-* | ||
.DS_Store | ||
*-darwin-x64 | ||
app-update.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# test directories | ||
__tests__ | ||
test | ||
tests | ||
powered-test | ||
|
||
# asset directories | ||
docs | ||
doc | ||
website | ||
images | ||
assets | ||
|
||
# examples | ||
example | ||
examples | ||
|
||
# code coverage directories | ||
coverage | ||
.nyc_output | ||
|
||
# build scripts | ||
Makefile | ||
Gulpfile.js | ||
Gruntfile.js | ||
|
||
# configs | ||
.tern-project | ||
.gitattributes | ||
.editorconfig | ||
.*ignore | ||
.eslintrc | ||
.jshintrc | ||
.flowconfig | ||
.documentup.json | ||
.yarn-metadata.json | ||
.*.yml | ||
*.yml | ||
|
||
# misc | ||
*.gz | ||
*.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
const { ipcRenderer, remote } = require('electron'); | ||
const $ = require('../util'); | ||
const EVENT = require('../db/events'); | ||
const dialog = remote.dialog; | ||
const appName = remote.app.getName(); | ||
const appVersion = remote.app.getVersion(); | ||
|
||
|
||
const send = (name, value) => ipcRenderer.send('updater', name, value); | ||
|
||
const events = { | ||
'checking-for-update': checkingForUpdate, | ||
'update-available': updateAvailable, | ||
'update-not-available': updateNotAvailable, | ||
'error': error, | ||
'download-progress': downloadProgress, | ||
'update-downloaded': updateDownloaded, | ||
}; | ||
|
||
|
||
function checkingForUpdate () { | ||
console.log('Checking for update...'); | ||
} | ||
|
||
function updateAvailable (resp) { | ||
dialog.showMessageBox({ | ||
type: 'question', | ||
title: 'Update', | ||
message: `There is a newer version available.\nYou have: ${appVersion}\nAvailable: ${resp.version}`, | ||
buttons: [ 'Cancel', 'Download' ], | ||
defaultId: 1, | ||
}, res => { if (res === 1) send('download'); }); | ||
} | ||
|
||
function updateNotAvailable () { | ||
dialog.showMessageBox({ | ||
type: 'info', | ||
title: 'Update', | ||
message: `You have the latest version of ${appName} ${appVersion}`, | ||
buttons: [ 'OK' ] | ||
}); | ||
} | ||
|
||
function error () { | ||
dialog.showErrorBox('Error', 'There was an error with the upload.\nPlease try again later.'); | ||
} | ||
|
||
function downloadProgress () { | ||
console.log('Downloading update...'); | ||
} | ||
|
||
function updateDownloaded () { | ||
dialog.showMessageBox({ | ||
type: 'question', | ||
title: 'Update', | ||
message: 'Update downloaded.\nDo you want to install it now or next time you start the app?', | ||
buttons: [ 'Install later', 'Quit and install' ], | ||
defaultId: 1, | ||
}, res => { if (res === 1) send('install'); }); | ||
} | ||
|
||
|
||
function checkForUpdates () { | ||
send('check'); | ||
} | ||
|
||
|
||
function onEvent (ev, name, params) { | ||
if (typeof events[name] === 'function') events[name](params); | ||
} | ||
|
||
|
||
function init () { | ||
ipcRenderer.on('updater', onEvent); | ||
$.on(EVENT.updater.check, checkForUpdates); | ||
} | ||
|
||
|
||
module.exports = { | ||
init | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
const { ipcMain } = require('electron'); | ||
const { autoUpdater } = require('electron-updater'); | ||
let win = null; | ||
|
||
const DEBUG = false; | ||
|
||
if (DEBUG) { | ||
const log = require('electron-log'); | ||
autoUpdater.logger = log; | ||
autoUpdater.logger.transports.file.level = 'debug'; | ||
autoUpdater.updateConfigPath = './app-update.yml'; | ||
// autoUpdater.autoDownload = true; | ||
} | ||
|
||
const send = (name, val) => win.webContents.send('updater', name, val); | ||
|
||
autoUpdater.on('checking-for-update', (ev) => send('checking-for-update', ev)); | ||
autoUpdater.on('update-available', (ev) => { send('update-available', ev); }); | ||
autoUpdater.on('update-not-available', (ev) => send('update-not-available', ev)); | ||
autoUpdater.on('error', (ev, err) => send('updater-error', JSON.stringify({ev, err}) )); | ||
autoUpdater.on('download-progress', (ev, progressObj) => send('download-progress', progressObj)); | ||
autoUpdater.on('update-downloaded', (ev) => send('update-downloaded', ev)); | ||
|
||
function init (currentWin) { | ||
win = currentWin; | ||
ipcMain.on('updater', (event, msg) => { | ||
if (msg === 'check') return autoUpdater.checkForUpdates(); | ||
if (msg === 'download') return autoUpdater.downloadUpdate(); | ||
if (msg === 'install') return autoUpdater.quitAndInstall(); | ||
}); | ||
} | ||
|
||
|
||
module.exports = { | ||
init | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
# Do not edit. File was generated by node-gyp's "configure" step | ||
{ | ||
"target_defaults": { | ||
"cflags": [], | ||
"default_configuration": "Release", | ||
"defines": [], | ||
"include_dirs": [], | ||
"libraries": [] | ||
}, | ||
"variables": { | ||
"asan": 0, | ||
"coverage": "false", | ||
"debug_devtools": "node", | ||
"force_dynamic_crt": 0, | ||
"host_arch": "x64", | ||
"icu_data_file": "icudt58l.dat", | ||
"icu_data_in": "../../deps/icu-small/source/data/in/icudt58l.dat", | ||
"icu_endianness": "l", | ||
"icu_gyp_path": "tools/icu/icu-generic.gyp", | ||
"icu_locales": "en,root", | ||
"icu_path": "deps/icu-small", | ||
"icu_small": "true", | ||
"icu_ver_major": "58", | ||
"llvm_version": 0, | ||
"node_byteorder": "little", | ||
"node_enable_d8": "false", | ||
"node_enable_v8_vtunejit": "false", | ||
"node_install_npm": "true", | ||
"node_module_version": 51, | ||
"node_no_browser_globals": "false", | ||
"node_prefix": "/", | ||
"node_release_urlbase": "https://nodejs.org/download/release/", | ||
"node_shared": "false", | ||
"node_shared_cares": "false", | ||
"node_shared_http_parser": "false", | ||
"node_shared_libuv": "false", | ||
"node_shared_openssl": "false", | ||
"node_shared_zlib": "false", | ||
"node_tag": "", | ||
"node_use_bundled_v8": "true", | ||
"node_use_dtrace": "true", | ||
"node_use_etw": "false", | ||
"node_use_lttng": "false", | ||
"node_use_openssl": "true", | ||
"node_use_perfctr": "false", | ||
"node_use_v8_platform": "true", | ||
"openssl_fips": "", | ||
"openssl_no_asm": 0, | ||
"shlib_suffix": "51.dylib", | ||
"target_arch": "x64", | ||
"uv_parent_path": "/deps/uv/", | ||
"uv_use_dtrace": "true", | ||
"v8_enable_gdbjit": 0, | ||
"v8_enable_i18n_support": 1, | ||
"v8_inspector": "true", | ||
"v8_no_strict_aliasing": 1, | ||
"v8_optimized_debug": 0, | ||
"v8_random_seed": 0, | ||
"v8_use_snapshot": "true", | ||
"want_separate_host_toolset": 0, | ||
"want_separate_host_toolset_mkpeephole": 0, | ||
"xcode_version": "7.0", | ||
"nodedir": "/Users/i313281/.node-gyp/7.7.1", | ||
"copy_dev_lib": "true", | ||
"standalone_static_library": 1 | ||
} | ||
} |
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.