-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.js
More file actions
41 lines (36 loc) · 958 Bytes
/
Copy pathmain.js
File metadata and controls
41 lines (36 loc) · 958 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
const { app, BrowserWindow, ipcMain } = require('electron')
const path = require('path')
const killPorts = require('./libs/utils.js')
const createWindow = () => {
const window = new BrowserWindow({
width: 1200,
height: 600,
minWidth: 1000,
minHeight: 600,
icon: path.join(__dirname, 'GitBuilding500x.png'),
webPreferences: {
nodeIntegration: true,
preload: path.join(__dirname, 'libs/preload.js')
}
})
window.loadFile('index.html')
}
app.whenReady().then(() => {
createWindow()
})
app.on('window-all-closed', function () {
killPorts()
if (process.platform !== 'darwin') app.quit()
})
ipcMain.on('open-project', (event, arg) => {
if (arg === 'open') {
const projectWindow = new BrowserWindow({
width: 800,
height: 800,
minWidth: 1000,
minHeight: 600,
icon: path.join(__dirname, 'GitBuilding500x.png')
})
projectWindow.loadURL('http://localhost:6178')
}
})