@@ -48,13 +48,12 @@ require("./menu/mainMenu");
4848// autoUpdater.logger.transports.file.level = "info";
4949// log.info("App starting...");
5050
51- console . log ( "app.name is ->" , app . name )
52-
5351let mainWindow ;
5452
55- // -----------------------------------------------------------------
56- // Create Touchbar buttons
57- // -----------------------------------------------------------------
53+ /****************************
54+ ** Create Touchbar buttons **
55+ *****************************/
56+
5857const tbSelectAllButton = new TouchBarButton ( {
5958 label : "Select All" ,
6059 backgroundColor : "#3DADC2" ,
@@ -116,9 +115,10 @@ const tbSpacer = new TouchBarSpacer();
116115const tbFlexSpacer = new TouchBarSpacer ( {
117116 size : "flexible" ,
118117} ) ;
119- // -----------------------------------------------------------------
120- // Attach earlier made buttons to a touch bar
121- // -----------------------------------------------------------------
118+
119+ /********************************
120+ ** Attach buttons to touchbar **
121+ ********************************/
122122
123123const touchBar = new TouchBar ( [
124124 tbSpacer ,
@@ -131,16 +131,34 @@ const touchBar = new TouchBar([
131131 tbClearAllButton ,
132132] ) ;
133133
134- // -----------------------------------------------
135- // prod / dev mode determined by boolean ' isDev'
136- // -----------------------------------------------
134+ /************************
135+ ******** SET isDev *****
136+ ************************/
137137
138138let isDev ;
139139// if using Spectron, run it in production
140140process . argv . includes ( "--noDevServer" ) || process . argv . includes ( "TEST_MODE" )
141141 ? ( isDev = false )
142142 : ( isDev = true ) ;
143- console . log ( "is this in dev mode? " , isDev ) ;
143+
144+ /*************************
145+ ******* MODE DISPLAY ****
146+ *************************/
147+
148+ isDev
149+ ? console . log ( `
150+
151+ ========================
152+ Launching in DEV mode
153+ ========================
154+ ` )
155+ : console . log ( `
156+
157+ ==============================
158+ Launching in PRODUCTION mode
159+ ==============================
160+ ` ) ;
161+
144162// let isDev = false;
145163// console.log("process.defaultApp ->", process.defaultApp);
146164// console.log("process.execPath -> ", process.execPath);
@@ -168,7 +186,7 @@ if (process.platform === "win32") {
168186}
169187
170188/***********************************************
171- ******* createWindow function declaration ******
189+ ******* createWindow function declaration *****
172190 ***********************************************/
173191
174192function createWindow ( ) {
@@ -190,28 +208,26 @@ function createWindow() {
190208 icon : `${ __dirname } /src/assets/icons/64x64.png` ,
191209 } ) ;
192210
193- if ( isDev ) {
194- // If we are in developer mode Add React & Redux DevTools to Electon App
195- installExtension ( REACT_DEVELOPER_TOOLS )
196- . then ( ( name ) => console . log ( `Added Extension: ${ name } ` ) )
197- . catch ( ( err ) => console . log ( "An error occurred: " , err ) ) ;
198-
199- installExtension ( REDUX_DEVTOOLS )
200- . then ( ( name ) => console . log ( `Added Extension: ${ name } ` ) )
201- . catch ( ( err ) => console . log ( "An error occurred: " , err ) ) ;
202- }
203-
204211 // and load the index.html of the app.
205212 let indexPath ;
206213
207- if ( isDev && process . argv . indexOf ( "--noDevServer" ) === - 1 ) {
214+ if ( isDev ) {
208215 // if we are in dev mode load up 'http://localhost:8080/index.html'
209216 indexPath = url . format ( {
210217 protocol : "http:" ,
211218 host : "localhost:8080" ,
212219 pathname : "index.html" ,
213220 slashes : true ,
214221 } ) ;
222+
223+ // If we are in developer mode Add React & Redux DevTools to Electon App
224+ installExtension ( REACT_DEVELOPER_TOOLS )
225+ . then ( ( name ) => console . log ( `Added Extension: ${ name } ` ) )
226+ . catch ( ( err ) => console . log ( "An error occurred: " , err ) ) ;
227+
228+ installExtension ( REDUX_DEVTOOLS )
229+ . then ( ( name ) => console . log ( `Added Extension: ${ name } ` ) )
230+ . catch ( ( err ) => console . log ( "An error occurred: " , err ) ) ;
215231 } else {
216232 indexPath = url . format ( {
217233 // if we are not in dev mode load production build file
0 commit comments