re-show window of app if re-run

This commit is contained in:
Stephen Birarda 2015-12-23 15:57:38 -07:00
parent 12bb2c1b7a
commit 2ed7d47938

View file

@ -73,6 +73,22 @@ app.on('activate', function(){
}
})
var shouldQuit = app.makeSingleInstance(function(commandLine, workingDirectory) {
// Someone tried to run a second instance, we should focus our window
if (mainWindow) {
if (mainWindow.isMinimized()) {
mainWindow.restore();
}
mainWindow.focus();
}
return true;
});
if (shouldQuit) {
app.quit();
return;
}
// Check command line arguments to see how to find binaries
var argv = require('yargs').argv;
var pathFinder = require('./modules/path-finder.js');