electron/spec/fixtures/api/singleton/main.js

14 lines
232 B
JavaScript
Raw Normal View History

const {app} = require('electron')
app.once('ready', () => {
console.log('started') // ping parent
})
const shouldExit = app.makeSingleInstance(() => {
process.nextTick(() => app.exit(0))
})
if (shouldExit) {
app.exit(1)
}