Last active
December 23, 2024 14:40
-
-
Save jlord/c7b3acfd3eda22c2b19f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var app = require('app'); | |
var BrowserWindow = require('browser-window'); | |
var glob = require('glob'); | |
var mainWindow = null; | |
// Require and setup each JS file in the main-process dir | |
glob('main-process/**/*.js', function (error, files) { | |
if (error) return console.log(error); | |
files.forEach(function (file) { | |
require('./' + file).setup(); | |
}); | |
}); | |
function createWindow () { | |
mainWindow = new BrowserWindow({ width: 920, height: 900 }); | |
mainWindow.loadURL('file://' + __dirname + '/index.html'); | |
mainWindow.on('closed', function () { | |
mainWindow = null; | |
}); | |
} | |
app.on('ready', createWindow); | |
app.on('window-all-closed', function () { | |
if (process.platform !== 'darwin') { | |
app.quit(); | |
} | |
}); | |
app.on('activate', function () { | |
if (mainWindow === null) { | |
createWindow(); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment