generated from sindresorhus/electron-boilerplate
-
-
Notifications
You must be signed in to change notification settings - Fork 104
/
index.js
43 lines (27 loc) · 859 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
const process = require( 'process' )
const { version } = require( './package.json' )
// CLI version
const args = new Set( process.argv.filter( ( element, i ) => ( ( i > 0 && i < 4 ) && String( element ).toLowerCase() ) ) )
if ( args.has( '--version' ) || args.has( '-v' ) ) {
process.stdout.write( version )
process.exit()
}
console.log( `CrossOver ${version}` )
// CLI arguments
if ( args.length > 0 ) {
console.log( 'Arguments:', args )
}
// Development mode
if ( args.has( '--debug' ) || args.has( '-d' ) ) {
console.log( '<Development Mode>' )
process.env.NODE_ENV = 'development'
process.env.ELECTRON_IS_DEV = 1
}
// Force the app to reset preferences
if ( args.has( '--reset' ) || args.has( '-r' ) ) {
console.log( '<Reset App>' )
process.env.CROSSOVER_RESET = true
}
// App entry
const main = require( './src/index.js' )
main()