ea6a926494
* test: add test for second-instance event parameter * robustify getting data from child process * fix test on windows * fix lint * Update api-app-spec.js * fix package-lock.json
18 lines
325 B
JavaScript
18 lines
325 B
JavaScript
const { app } = require('electron')
|
|
|
|
app.once('ready', () => {
|
|
console.log('started') // ping parent
|
|
})
|
|
|
|
const gotTheLock = app.requestSingleInstanceLock()
|
|
|
|
app.on('second-instance', (event, args) => {
|
|
setImmediate(() => {
|
|
console.log(JSON.stringify(args))
|
|
app.exit(0)
|
|
})
|
|
})
|
|
|
|
if (!gotTheLock) {
|
|
app.exit(1)
|
|
}
|