launch vscode via child process
This commit is contained in:
parent
1ab3fdb3ea
commit
40bcdd6898
@ -1,4 +1,5 @@
|
||||
const ws = require('nodejs-websocket')
|
||||
const { spawn } = require('child_process')
|
||||
|
||||
const createServer = () => {
|
||||
let server = ws.createServer(connection => {
|
||||
@ -11,6 +12,19 @@ const createServer = () => {
|
||||
let contextId = resultObject.data.contextId
|
||||
let projectHome = resultObject.data.projectHome
|
||||
console.log(projectHome)
|
||||
|
||||
const code = spawn('code', [projectHome])
|
||||
code.stdout.on('data', (data) => {
|
||||
console.log(`stdout: ${data}`)
|
||||
})
|
||||
|
||||
code.stderr.on('data', (data) => {
|
||||
console.error(`stderr: ${data}`)
|
||||
})
|
||||
|
||||
code.on('close', (code) => {
|
||||
console.log(`child process exited with code ${code}`)
|
||||
});
|
||||
break
|
||||
}
|
||||
})
|
||||
|
Reference in New Issue
Block a user