Skip to content

Commit e495139

Browse files
committed
Update: Adding packaging and publishing.
1 parent 0e31c0f commit e495139

File tree

13 files changed

+1450
-99
lines changed

13 files changed

+1450
-99
lines changed

.DS_Store

8 KB
Binary file not shown.

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
node_modules
2-
build
32
app/bower_components
3+
dist

app/main.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ const app = electron.app;
33
const ipc = require('electron').ipcMain;
44
const dialog = require('electron').dialog;
55
const {ArcWindowsManager} = require('./scripts/windows-manager');
6+
const log = require('electron-log');
7+
const {autoUpdater} = require('electron-updater');
8+
autoUpdater.logger = log;
9+
autoUpdater.logger.transports.file.level = 'info';
10+
log.info('App starting...');
611

712
class Arc {
813
constructor() {
@@ -17,6 +22,7 @@ class Arc {
1722

1823
_readyHandler() {
1924
this.wm.open();
25+
autoUpdater.checkForUpdates();
2026
}
2127
// Quits when all windows are closed.
2228
_allClosedHandler() {
@@ -31,6 +37,10 @@ class Arc {
3137
this.wm.open();
3238
}
3339
}
40+
41+
notifyWindows(type, ...args) {
42+
this.wm.notifyAll(type, args);
43+
}
3444
}
3545

3646
const arcApp = new Arc();
@@ -57,3 +67,24 @@ ipc.on('new-window', function() {
5767
ipc.on('toggle-devtools', (event) => {
5868
event.sender.webContents.toggleDevTools();
5969
});
70+
71+
// Auto updater
72+
autoUpdater.on('checking-for-update', () => {
73+
arcApp.notifyWindows('autoupdate-checking-for-update');
74+
});
75+
autoUpdater.on('update-available', (info) => {
76+
arcApp.notifyWindows('autoupdate-update-available', info);
77+
});
78+
autoUpdater.on('update-not-available', (info) => {
79+
arcApp.notifyWindows('autoupdate-update-not-available', info);
80+
});
81+
autoUpdater.on('error', (err) => {
82+
arcApp.notifyWindows('autoupdate-error', err);
83+
});
84+
autoUpdater.on('download-progress', (progressObj) => {
85+
arcApp.notifyWindows('autoupdate-download-progress', progressObj);
86+
});
87+
autoUpdater.on('update-downloaded', (info) => {
88+
arcApp.notifyWindows('autoupdate-update-downloaded', info);
89+
// autoUpdater.quitAndInstall();
90+
});

app/scripts/windows-manager.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,17 @@ class ArcWindowsManager {
1717
get hasWindow() {
1818
return this.windows.length > 0;
1919
}
20+
/**
21+
* Notifies all opened windows with event data.
22+
*
23+
* @param {String} type Event type (channel name)
24+
* @param {?Array} args List of arguments.
25+
*/
26+
notifyAll(type, args) {
27+
this.windows.forEach(win => {
28+
win.webContents.send(type, args);
29+
});
30+
}
2031

2132
open(path) {
2233
var index = this.windows.length;

build/.DS_Store

8 KB
Binary file not shown.

build/config.gypi

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# Do not edit. File was generated by node-gyp's "configure" step
2+
{
3+
"target_defaults": {
4+
"cflags": [],
5+
"default_configuration": "Release",
6+
"defines": [],
7+
"include_dirs": [],
8+
"libraries": []
9+
},
10+
"variables": {
11+
"asan": 0,
12+
"coverage": "false",
13+
"debug_devtools": "node",
14+
"debug_http2": "false",
15+
"debug_nghttp2": "false",
16+
"force_dynamic_crt": 0,
17+
"host_arch": "x64",
18+
"icu_data_file": "icudt59l.dat",
19+
"icu_data_in": "../../deps/icu-small/source/data/in/icudt59l.dat",
20+
"icu_endianness": "l",
21+
"icu_gyp_path": "tools/icu/icu-generic.gyp",
22+
"icu_locales": "en,root",
23+
"icu_path": "deps/icu-small",
24+
"icu_small": "true",
25+
"icu_ver_major": "59",
26+
"llvm_version": 0,
27+
"node_byteorder": "little",
28+
"node_enable_d8": "false",
29+
"node_enable_v8_vtunejit": "false",
30+
"node_install_npm": "true",
31+
"node_module_version": 57,
32+
"node_no_browser_globals": "false",
33+
"node_prefix": "/usr/local",
34+
"node_release_urlbase": "https://nodejs.org/download/release/",
35+
"node_shared": "false",
36+
"node_shared_cares": "false",
37+
"node_shared_http_parser": "false",
38+
"node_shared_libuv": "false",
39+
"node_shared_openssl": "false",
40+
"node_shared_zlib": "false",
41+
"node_tag": "",
42+
"node_use_bundled_v8": "true",
43+
"node_use_dtrace": "true",
44+
"node_use_etw": "false",
45+
"node_use_lttng": "false",
46+
"node_use_openssl": "true",
47+
"node_use_perfctr": "false",
48+
"node_use_v8_platform": "true",
49+
"node_without_node_options": "false",
50+
"openssl_fips": "",
51+
"openssl_no_asm": 0,
52+
"shlib_suffix": "57.dylib",
53+
"target_arch": "x64",
54+
"uv_parent_path": "/deps/uv/",
55+
"uv_use_dtrace": "true",
56+
"v8_enable_gdbjit": 0,
57+
"v8_enable_i18n_support": 1,
58+
"v8_enable_inspector": 1,
59+
"v8_no_strict_aliasing": 1,
60+
"v8_optimized_debug": 0,
61+
"v8_promise_internal_field_count": 1,
62+
"v8_random_seed": 0,
63+
"v8_trace_maps": 0,
64+
"v8_use_snapshot": "true",
65+
"want_separate_host_toolset": 0,
66+
"want_separate_host_toolset_mkpeephole": 0,
67+
"xcode_version": "7.0",
68+
"nodedir": "/Users/pawelpsztyc/.node-gyp/8.5.0",
69+
"standalone_static_library": 1
70+
}
71+
}

build/icons/128x128.png

2.41 KB
Loading

build/icons/16x16.png

571 Bytes
Loading

build/icons/256x256.png

4.6 KB
Loading

build/icons/32x32.png

867 Bytes
Loading

0 commit comments

Comments
 (0)