chore: refactor code

This commit is contained in:
Rudra Saraswat 2025-04-23 15:44:57 +01:00
parent fd25400633
commit fce7c69dc7
13 changed files with 23 additions and 1306 deletions

View file

@ -160,10 +160,15 @@ function loadTerminalWindow(title, cmd) {
if (!terminalWindow.isDestroyed()) {
terminalWindow.webContents.send("terminal.reset")
terminalWindow.hide()
if (title.startsWith('Creating container: ')) {
mainWindow.webContents.send("container-created")
} else if (title.startsWith('Package installation')) {
packageWindow.webContents.send("installation-complete")
try {
if (title.startsWith('Creating container: ')) {
mainWindow.webContents.send("container-created")
} else if (title.startsWith('Package installation')) {
packageWindow.webContents.send("installation-complete")
}
} catch (err) {
console.log(err)
app.quit()
}
}
})
@ -178,10 +183,8 @@ function loadTerminalWindow(title, cmd) {
app.whenReady().then(() => {
app.allowRendererProcessReuse = false
if (process.argv.length > 2) {
if (process.argv[2] == 'package') {
createPackageWindow()
}
if (process.argv.includes('package')) {
createPackageWindow()
} else {
createWindow()
}
@ -196,4 +199,4 @@ app.whenReady().then(() => {
app.on('window-all-closed', function () {
if (process.platform !== 'darwin') app.quit()
})
})