I want to create vs code task which create folder of given name and , below is the definition of task, it is working fine
here is my task
{
"version": "2.0.0",
"tasks": [
{
"label": "node file",
"detail": "Create file from node",
"type": "shell",
"command": "node ./.vscode/hello.js",
"presentation": {
"reveal": "silent",
"panel": "shared"
},
"args": ["${input:name}"],
"problemMatcher": []
}
],
"inputs": [
{
"id": "name",
"description": "Name your file",
"default": "new-file",
"type": "promptString"
}
]
}
.vscode/hello.js
import fs from "fs";
fs.writeFile("filename.html", "HTML content", function (err) {
if (err) throw err;
console.log("Saved!");
});
but problem is how to send input into the script file hello.js so that it create that file name with content.
how can we achive this?
Refrence: Tasks in vs code