Commit 0fbd4f83 authored by 阮传宙's avatar 阮传宙

fix: 兼容window启动

parent b9523143
...@@ -33,16 +33,11 @@ function javaServer() { ...@@ -33,16 +33,11 @@ function javaServer() {
log.info(shell.ls()) log.info(shell.ls())
const child = shell.exec(exePath + ' -jar syc-paas-standalone-biz.jar -spring.config.location=file:./baseServer/config/boostrap.yml &', { async: true }) const child = shell.exec(exePath + ' -jar syc-paas-standalone-biz.jar -spring.config.location=file:./baseServer/config/boostrap.yml &', { async: true })
let isStart = false let isStart = false
child.stdout.on('data', function (stdout) { child.stdout.on('data', function (stdout) {
log.info(stdout, '----') log.info(stdout, '----')
if (stdout.includes('http://localhost') && !isStart) { if (stdout.includes('http://localhost') && !isStart) {
if (!isMac()) { ipcRenderer.send("close", MESSAGE_TYPE.DESIGN);
process.send('close')
} else {
ipcRenderer.send("close", MESSAGE_TYPE.DESIGN);
}
isStart = true isStart = true
} }
}) })
......
...@@ -38,23 +38,15 @@ class ProcessActivity { ...@@ -38,23 +38,15 @@ class ProcessActivity {
if (args.length) { if (args.length) {
forkParam = [shellPath, args] forkParam = [shellPath, args]
} }
let child = null
if (utils.isMac()) { let child = child = utilityProcess.fork(...forkParam)
child = utilityProcess.fork(...forkParam)
} else {
child = fork(...forkParam)
}
child.on('message', (data) => { child.on('message', (data) => {
const childParam = { data, child } const childParam = { data, child }
if (args.length || cb) { if (args.length || cb) {
return this.watchGlobalMsg(childParam, cb) return this.watchGlobalMsg(childParam, cb)
} }
this.handleDefaultProcessEnd(childParam) this.handleDefaultProcessEnd(childParam)
if (data === 'close') {
this.ctx.win.close()
}
}) })
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment