11/// <reference path="./custom_types/electron-is-dev.d.ts"/>
2+ /// <reference path="./custom_types/command-line-args.d.ts"/>
23
34import { app , BrowserWindow , ipcMain } from 'electron' ;
45import { autoUpdater } from 'electron-updater' ;
@@ -8,9 +9,17 @@ import { ProgressInfo } from 'electron-builder-http/out/ProgressCallbackTransfor
89import { VersionInfo } from 'electron-builder-http/out/publishOptions' ;
910import * as settings from 'electron-settings' ;
1011import * as isDev from 'electron-is-dev' ;
12+ import * as commandLineArgs from 'command-line-args' ;
1113
1214import { IpcEvents } from './shared/util' ;
1315import { ElectronDataStorageRepositoryService } from './services/electron-datastorage-repository.service' ;
16+ import { CommandLineArgs } from './shared/models/command-line-args' ;
17+
18+ const optionDefinitions = [
19+ { name : 'addons' , type : Boolean , defaultOption : false }
20+ ] ;
21+
22+ const options : CommandLineArgs = commandLineArgs ( optionDefinitions ) ;
1423
1524// import './dev-extension';
1625require ( 'electron-debug' ) ( { showDevTools : false , enabled : true } ) ;
@@ -143,6 +152,8 @@ ipcMain.on(IpcEvents.app.appStarted, () => {
143152
144153ipcMain . on ( IpcEvents . autoUpdater . checkForUpdate , ( ) => checkForUpdate ( ) ) ;
145154
155+ ipcMain . on ( IpcEvents . app . getCommandLineArgs , ( event : any ) => event . sender . send ( IpcEvents . app . getCommandLineArgsReply , options ) ) ;
156+
146157function isFirstRun ( ) {
147158 if ( ! settings . has ( 'firstRunVersion' ) ) {
148159 return true ;
0 commit comments