Skip to content

Commit b671f86

Browse files
committed
Add launch config to automatically run Node sample on F5 VS Code
1 parent 8634d72 commit b671f86

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"type": "node",
9+
"request": "launch",
10+
"name": "Launch Program",
11+
"program": "${workspaceFolder}\\.vscode\\vsCodeLaunchNodeSample.js"
12+
}
13+
]
14+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
const {exec} = require('child_process');
2+
const path = require("path");
3+
exec('npm install && npm start',{cwd:path.resolve('.\\App')}, (err, output) => {
4+
// once the command has completed, the callback function is called
5+
if (err) {
6+
// log and return if we encounter an error
7+
console.error("Error on running commands: ", err)
8+
return
9+
}
10+
// log the output received from the command
11+
console.log("Output: \n", output)
12+
})

0 commit comments

Comments
 (0)