@@ -16,7 +16,7 @@ if (typeof process.setFdLimit === 'function') {
1616 process . setFdLimit ( 1024 ) ;
1717}
1818
19- const setupConfigDir = ( args ) => {
19+ const setupConfigDir = args => {
2020 let dirname = 'Mailspring' ;
2121 if ( args . devMode ) {
2222 dirname = 'Mailspring-dev' ;
@@ -42,7 +42,7 @@ const setupConfigDir = (args) => {
4242 return configDirPath ;
4343} ;
4444
45- const setupCompileCache = ( configDirPath ) => {
45+ const setupCompileCache = configDirPath => {
4646 const compileCache = require ( '../compile-cache' ) ;
4747 return compileCache . setHomeDirectory ( configDirPath ) ;
4848} ;
@@ -59,13 +59,16 @@ const setupErrorLogger = (args = {}) => {
5959 return errorLogger ;
6060} ;
6161
62- const declareOptions = ( argv ) => {
62+ const declareOptions = argv => {
6363 const optimist = require ( 'optimist' ) ;
6464 const options = optimist ( argv ) ;
6565 options . usage (
6666 `Mailspring\n\nUsage: mailspring [options] [recipient] [attachment]\n\nRun Mailspring: The open source extensible email client\n\n\`mailspring mailto:johndoe@example.com\` to compose an e-mail to johndoe@example.com.\n\`mailspring ./attachment.txt\` to compose an e-mail with a text file attached.\n\`mailspring --dev\` to start the client in dev mode.\n\`mailspring --test\` to run unit tests.`
6767 ) ;
68- options . alias ( 'd' , 'dev' ) . boolean ( 'd' ) . describe ( 'd' , 'Run in development mode.' ) ;
68+ options
69+ . alias ( 'd' , 'dev' )
70+ . boolean ( 'd' )
71+ . describe ( 'd' , 'Run in development mode.' ) ;
6972 options
7073 . alias ( 't' , 'test' )
7174 . boolean ( 't' )
@@ -82,8 +85,14 @@ const declareOptions = (argv) => {
8285 options . boolean ( 'enable-crashpad' ) ;
8386 options . boolean ( 'allow-file-access-from-files' ) ;
8487 options . boolean ( 'source-app-id' ) ;
85- options . alias ( 'h' , 'help' ) . boolean ( 'h' ) . describe ( 'h' , 'Print this usage message.' ) ;
86- options . alias ( 'l' , 'log-file' ) . string ( 'l' ) . describe ( 'l' , 'Log all test output to file.' ) ;
88+ options
89+ . alias ( 'h' , 'help' )
90+ . boolean ( 'h' )
91+ . describe ( 'h' , 'Print this usage message.' ) ;
92+ options
93+ . alias ( 'l' , 'log-file' )
94+ . string ( 'l' )
95+ . describe ( 'l' , 'Log all test output to file.' ) ;
8796 options
8897 . alias ( 'c' , 'config-dir-path' )
8998 . string ( 'c' )
@@ -99,12 +108,18 @@ const declareOptions = (argv) => {
99108 'f' ,
100109 'Override the default file regex to determine which tests should run (defaults to "-spec.(js|jsx|es6|es)$" )'
101110 ) ;
102- options . alias ( 'v' , 'version' ) . boolean ( 'v' ) . describe ( 'v' , 'Print the version.' ) ;
103- options . alias ( 'b' , 'background' ) . boolean ( 'b' ) . describe ( 'b' , 'Start Mailspring in the background' ) ;
111+ options
112+ . alias ( 'v' , 'version' )
113+ . boolean ( 'v' )
114+ . describe ( 'v' , 'Print the version.' ) ;
115+ options
116+ . alias ( 'b' , 'background' )
117+ . boolean ( 'b' )
118+ . describe ( 'b' , 'Start Mailspring in the background' ) ;
104119 return options ;
105120} ;
106121
107- const parseCommandLine = ( argv ) => {
122+ const parseCommandLine = argv => {
108123 const pkg = require ( '../../package.json' ) ;
109124 const version = `${ pkg . version } -${ pkg . commitHash } ` ;
110125
@@ -191,7 +206,7 @@ const parseCommandLine = (argv) => {
191206 } ;
192207} ;
193208
194- const extractMailtoLink = ( mailtoLink ) => {
209+ const extractMailtoLink = mailtoLink => {
195210 console . log ( mailtoLink ) ;
196211
197212 // Handle links in the form mailto:test@example .com?attach=file:///path/to/file.txt
@@ -277,10 +292,9 @@ const start = () => {
277292 // into the Start Menu shortcut. Without this, action/reply notification
278293 // events are silently dropped (COM server is never registered).
279294 app . setToastActivatorCLSID ( '{E6AD16B0-2830-48E7-9DB7-439152FA917B}' ) ;
295+ app . setAppUserModelId ( 'com.squirrel.mailspring.mailspring' ) ;
280296 }
281297
282- app . setAppUserModelId ( 'com.squirrel.mailspring.mailspring' ) ;
283-
284298 // Set the app name explicitly for Linux to ensure the system tray icon
285299 // gets a unique ID. Without this, all Electron apps share the same
286300 // StatusNotifierItem ID on Linux, causing their tray visibility settings
@@ -381,7 +395,7 @@ const start = () => {
381395 . replace ( 'app.asar' , 'app.asar.unpacked' ) ,
382396 { allowFileAccess : true }
383397 )
384- . catch ( ( err ) => console . error ( `Error loading language detection extension: ${ err } ` ) ) ;
398+ . catch ( err => console . error ( `Error loading language detection extension: ${ err } ` ) ) ;
385399
386400 session . defaultSession . webRequest . onBeforeSendHeaders ( o365Filter , ( details , callback ) => {
387401 delete details . requestHeaders [ 'Origin' ] ;
@@ -406,9 +420,8 @@ const start = () => {
406420 } ) ;
407421
408422 // eslint-disable-next-line
409- const Application = require (
410- path . join ( options . resourcePath , 'src' , 'browser' , 'application' )
411- ) . default ;
423+ const Application = require ( path . join ( options . resourcePath , 'src' , 'browser' , 'application' ) )
424+ . default ;
412425 global . application = new Application ( ) ;
413426 global . application . start ( options ) ;
414427
0 commit comments