-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
executable file
·36 lines (30 loc) · 843 Bytes
/
index.js
File metadata and controls
executable file
·36 lines (30 loc) · 843 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
var vscode = require("vscode");
var child_process = require("child_process");
var path = require("path");
var cProc;
function createChild() {
cProc = child_process.spawn(path.join(__dirname,"child.cmd"));
}
function cleanupChild() {
if (cProc) {
cProc.kill();
child_process.exec("taskkill /pid " + cProc.pid + " /T /F");
cProc = null;
}
}
function activate(context) {
context.subscriptions.push(vscode.commands.registerCommand(
"test.spawn_child_process",
createChild
));
context.subscriptions.push(vscode.commands.registerCommand(
"test.kill_child_process",
cleanupChild
));
}
function deactivate() {
console.log("Deactivating");
cleanupChild();
}
exports.activate = activate;
exports.deactivate = deactivate;