Skip to content

Commit

Permalink
Update index.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Igor Lins e Silva committed Jul 18, 2019
1 parent b880cab commit cdf07cd
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,10 @@ if (isAutoLaunch) {
app.quit();
}
});
app.on("quit", () => {
unlinkLALock();
});

app.on('ready', () => {
clearLock();
appendLock();
Expand Down Expand Up @@ -693,13 +697,15 @@ if (isAutoLaunch) {
setupExpress();
launchApp();

// add agent
if (!devMode) {
const spawn = require('child_process').spawn;
spawn(process.execPath, ['--autostart'], {
stdio: 'ignore',
detached: true
}).unref();
if (!fs.existsSync(lockAutoLaunchFile)) {
// add agent
if (!devMode) {
const spawn = require('child_process').spawn;
spawn(process.execPath, ['--autostart'], {
stdio: 'ignore',
detached: true
}).unref();
}
}
}

Expand Down

0 comments on commit cdf07cd

Please sign in to comment.