File tree Expand file tree Collapse file tree 2 files changed +17
-7
lines changed Expand file tree Collapse file tree 2 files changed +17
-7
lines changed Original file line number Diff line number Diff line change
1
+
2
+ import * as fs from 'fs' ;
3
+ import * as path from 'path' ;
4
+ import { app } from 'electron' ;
5
+
6
+
7
+
8
+ export const appConfig = JSON . parse (
9
+ fs . readFileSync ( path . join ( app . getAppPath ( ) , 'config/app-config.json' ) ) . toString ( ) ) ;
Original file line number Diff line number Diff line change 1
1
2
2
// Modules to control application life and create native browser window
3
- import * as fs from 'fs' ;
4
3
import * as url from 'url' ;
5
4
import * as path from 'path' ;
6
5
import { app , protocol } from 'electron' ;
7
- import { createMainWindow } from './windows/MainWindow' ;
8
6
9
7
8
+ // Window
9
+
10
+ import { appConfig } from './lib/conf' ;
11
+ import { createMainWindow } from './windows/MainWindow' ;
12
+
10
13
11
14
// IPC events
12
15
13
- // tslint:disable-next-line:no-var-requires
14
- require ( './ipc/app' ) ;
15
- // tslint:disable-next-line:no-var-requires
16
- require ( './ipc/views.Home' ) ;
16
+ import './ipc/app' ;
17
+ import './ipc/views.Home' ;
17
18
18
19
19
20
// Read the application config.
20
21
// tslint:disable-next-line:no-console
21
- console . log ( 'app config: ' + fs . readFileSync ( path . join ( app . getAppPath ( ) , 'config/app-config.json' ) ) . toString ( ) ) ;
22
+ console . log ( 'app config: ' + JSON . stringify ( appConfig , null , 2 ) ) ;
22
23
23
24
24
25
// App lifecycle events.
You can’t perform that action at this time.
0 commit comments