change open way of source

This commit is contained in:
王劲鹏 2019-11-12 20:04:18 +08:00
parent 40bcdd6898
commit cdde8c9c3d

View File

@ -13,18 +13,21 @@ const createServer = () => {
let projectHome = resultObject.data.projectHome let projectHome = resultObject.data.projectHome
console.log(projectHome) console.log(projectHome)
const code = spawn('code', [projectHome]) {
code.stdout.on('data', (data) => { const code = spawn('code', [projectHome, projectHome + "/src/Snake.ts"])
console.log(`stdout: ${data}`) code.stdout.on('data', (data) => {
}) console.log(`stdout: ${data}`)
})
code.stderr.on('data', (data) => { code.stderr.on('data', (data) => {
console.error(`stderr: ${data}`) console.error(`stderr: ${data}`)
}) })
code.on('close', (code) => {
console.log(`child process exited with code ${code}`)
})
}
code.on('close', (code) => {
console.log(`child process exited with code ${code}`)
});
break break
} }
}) })