3e2ec0e2ce
* Update represented-file fiddle. * add index and code back to guide Co-authored-by: Ethan Arrowood <ethan.arrowood@gmail.com>
30 lines
553 B
JavaScript
30 lines
553 B
JavaScript
const { app, BrowserWindow } = require('electron')
|
|
const os = require('os');
|
|
|
|
function createWindow () {
|
|
const win = new BrowserWindow({
|
|
width: 800,
|
|
height: 600
|
|
})
|
|
|
|
win.loadFile('index.html')
|
|
}
|
|
|
|
app.whenReady().then(() => {
|
|
const win = new BrowserWindow()
|
|
|
|
win.setRepresentedFilename(os.homedir())
|
|
win.setDocumentEdited(true)
|
|
})
|
|
|
|
app.on('window-all-closed', () => {
|
|
if (process.platform !== 'darwin') {
|
|
app.quit()
|
|
}
|
|
})
|
|
|
|
app.on('activate', () => {
|
|
if (BrowserWindow.getAllWindows().length === 0) {
|
|
createWindow()
|
|
}
|
|
})
|