@@ -4,7 +4,6 @@ const path = require('path');
4
4
const cProcess = require ( 'child_process' ) . spawn ;
5
5
const portscanner = require ( 'portscanner' ) ;
6
6
const imageSize = require ( 'image-size' ) ;
7
- const chalk = require ( 'chalk' ) ;
8
7
let io , server , browserWindows , ipc , apiProcess , loadURL ;
9
8
let appApi , menu , dialogApi , notification , tray , webContents ;
10
9
let globalShortcut , shellApi , screen , clipboard , autoUpdater ;
@@ -56,7 +55,7 @@ app.on('ready', () => {
56
55
57
56
// hostname needs to belocalhost, otherwise Windows Firewall will be triggered.
58
57
portscanner . findAPortNotInUse ( 8000 , 65535 , 'localhost' , function ( error , port ) {
59
- console . log ( chalk . blue ( 'Electron Socket IO Port: ' + port ) ) ;
58
+ console . log ( 'Electron Socket IO Port: ' + port ) ;
60
59
startSocketApiBridge ( port ) ;
61
60
} ) ;
62
61
@@ -76,8 +75,8 @@ function startSplashScreen() {
76
75
let imageFile = path . join ( currentBinPath , manifestJsonFile . splashscreen . imageFile ) ;
77
76
imageSize ( imageFile , ( error , dimensions ) => {
78
77
if ( error ) {
79
- console . log ( chalk . bold . red ( `load splashscreen error:` ) ) ;
80
- console . log ( chalk . bold . red ( error ) ) ;
78
+ console . log ( `load splashscreen error:` ) ;
79
+ console . error ( error ) ;
81
80
82
81
throw new Error ( error . message ) ;
83
82
}
@@ -118,7 +117,7 @@ function startSocketApiBridge(port) {
118
117
119
118
server . listen ( port , 'localhost' ) ;
120
119
server . on ( 'listening' , function ( ) {
121
- console . log ( chalk . bgGreenBright ( 'Electron Socket started on port %s at %s' , server . address ( ) . port , server . address ( ) . address ) ) ;
120
+ console . log ( 'Electron Socket started on port %s at %s' , server . address ( ) . port , server . address ( ) . address ) ;
122
121
// Now that socket connection is established, we can guarantee port will not be open for portscanner
123
122
if ( watchable ) {
124
123
startAspCoreBackendWithWatch ( port ) ;
@@ -137,7 +136,7 @@ function startSocketApiBridge(port) {
137
136
// otherwise it will fire the same event multiple depends how many time
138
137
// live reload watch happen.
139
138
socket . on ( 'disconnect' , function ( ) {
140
- console . log ( chalk . bold . red ( 'Got disconnect!' ) ) ;
139
+ console . log ( 'Got disconnect!' ) ;
141
140
delete require . cache [ require . resolve ( './api/app' ) ] ;
142
141
delete require . cache [ require . resolve ( './api/browserWindows' ) ] ;
143
142
delete require . cache [ require . resolve ( './api/commandLine' ) ] ;
@@ -157,7 +156,7 @@ function startSocketApiBridge(port) {
157
156
158
157
global [ 'electronsocket' ] = socket ;
159
158
global [ 'electronsocket' ] . setMaxListeners ( 0 ) ;
160
- console . log ( chalk . bold . bgCyan ( 'ASP.NET Core Application connected...' , 'global.electronsocket' , global [ 'electronsocket' ] . id , new Date ( ) ) ) ;
159
+ console . log ( 'ASP.NET Core Application connected...' , 'global.electronsocket' , global [ 'electronsocket' ] . id , new Date ( ) ) ;
161
160
162
161
appApi = require ( './api/app' ) ( socket , app ) ;
163
162
browserWindows = require ( './api/browserWindows' ) ( socket , app ) ;
@@ -186,7 +185,7 @@ function startSocketApiBridge(port) {
186
185
hostHook . onHostReady ( ) ;
187
186
}
188
187
} catch ( error ) {
189
- console . log ( chalk . bold . red ( error . message ) ) ;
188
+ console . error ( error . message ) ;
190
189
}
191
190
} ) ;
192
191
}
@@ -252,7 +251,7 @@ function startAspCoreBackendWithWatch(electronPort) {
252
251
apiProcess = cProcess ( 'dotnet' , parameters , options ) ;
253
252
254
253
apiProcess . stdout . on ( 'data' , ( data ) => {
255
- console . log ( chalk . bold . blue ( ` ${ data . toString ( ) } `) ) ;
254
+ console . log ( `stdout: ${ data . toString ( ) } `) ;
256
255
} ) ;
257
256
}
258
257
}
0 commit comments