99 * `./app/main.prod.js` using webpack. This gives us some performance wins.
1010 */
1111import path from 'path' ;
12- import { app , BrowserWindow , ipcMain } from 'electron' ;
12+ import { app , BrowserWindow , ipcMain , dialog } from 'electron' ;
1313import { autoUpdater } from 'electron-updater' ;
1414import log from 'electron-log' ;
15+ import { Intent } from '@blueprintjs/core' ;
1516import MenuBuilder from './menu' ;
1617import { Events } from './events' ;
1718import { bus , init } from './message-bus' ;
@@ -101,6 +102,11 @@ const createWindow = async () => {
101102 // Remove this if your app does not use auto updates
102103 // eslint-disable-next-line
103104 new AppUpdater ( ) ;
105+
106+ const x = await autoUpdater . checkForUpdatesAndNotify ( ) ;
107+ console . log ( 'UPDATE ----------------------' ) ;
108+ console . log ( x ) ;
109+ console . log ( '=========================' ) ;
104110} ;
105111
106112/**
@@ -128,14 +134,17 @@ app.on('activate', () => {
128134 */
129135
130136ipcMain . on ( Events . Compare , async ( event , args ) => {
131- const { file, values , output } = args ;
137+ const { file, compare , output } = args ;
132138 try {
133139 bus . message ( 'Starting compare process' ) ;
134- const result = await xlsxFunctions . doCompare ( values , file ) ;
140+ const result = await xlsxFunctions . doCompare ( compare , file ) ;
135141 await result . xlsx . writeFile ( output ) ;
136- bus . message ( 'Compare process done and file has been output' ) ;
142+ bus . message (
143+ 'Compare process done and file has been output' ,
144+ Intent . SUCCESS
145+ ) ;
137146 } catch ( e ) {
138- bus . message ( e . message || e , 'error' ) ;
147+ bus . message ( e . message || e , Intent . ERROR ) ;
139148 }
140149} ) ;
141150
@@ -145,9 +154,21 @@ ipcMain.on(Events.Merge, async (event, args) => {
145154 bus . message ( 'Starting merge process' ) ;
146155 const result = await xlsxFunctions . doMerge ( files ) ;
147156 await result . xlsx . writeFile ( output ) ;
148- bus . message ( 'Merge process done and file has been output' ) ;
157+ bus . message ( 'Merge process done and file has been output' , Intent . SUCCESS ) ;
158+ } catch ( e ) {
159+ bus . message ( e . message || e , Intent . ERROR ) ;
160+ }
161+ } ) ;
162+
163+ ipcMain . on ( Events . Find , async ( event , args ) => {
164+ const { files, output, columns, word } = args ;
165+ try {
166+ bus . message ( 'Starting find process' ) ;
167+ const result = await xlsxFunctions . doFind ( { columns, word } , files ) ;
168+ await result . xlsx . writeFile ( output ) ;
169+ bus . message ( 'Find process complete' , Intent . SUCCESS ) ;
149170 } catch ( e ) {
150- bus . message ( e . message || e , 'error' ) ;
171+ bus . message ( e . message || e , Intent . ERROR ) ;
151172 }
152173} ) ;
153174
0 commit comments