mirror of
https://github.com/geekgeekrun/geekgeekrun.git
synced 2026-09-05 23:47:54 +08:00
add check dependencies logic before automatic start
This commit is contained in:
@@ -101,13 +101,8 @@ export function createMainWindow(): void {
|
||||
env: subProcessEnv,
|
||||
stdio: [null, null, null, 'pipe']
|
||||
})
|
||||
subProcessOfPuppeteer.once('exit', () => {
|
||||
mainWindow.webContents.send('geek-auto-start-chat-with-boss-stopped')
|
||||
|
||||
subProcessOfPuppeteer = null
|
||||
})
|
||||
console.log(subProcessOfPuppeteer)
|
||||
return new Promise((resolve) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
subProcessOfPuppeteer!.stdio[3]!.pipe(JSONStream.parse()).on('data', (raw) => {
|
||||
const data = raw
|
||||
switch (data.type) {
|
||||
@@ -120,6 +115,16 @@ export function createMainWindow(): void {
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
subProcessOfPuppeteer!.once('exit', (exitCode) => {
|
||||
subProcessOfPuppeteer = null
|
||||
if (exitCode === 1) {
|
||||
// means cannot find downloaded puppeteer
|
||||
reject('NEED_TO_CHECK_RUNTIME_DEPENDENCIES')
|
||||
} else {
|
||||
mainWindow.webContents.send('geek-auto-start-chat-with-boss-stopped')
|
||||
}
|
||||
})
|
||||
})
|
||||
// TODO:
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user