When developing a vscode Extension is it possible to have separate bash scripts inside the code of the Extension which can be executed in the vscode instance where the extension is installed?
Imagine i have .sh scripts beside my extension.ts. When Running the extension i want to be able to open a Terminal per script and execute the scripts.
I can‘t find a way to achieve this
Edit:
My folder structure in the extension repo looks like:
- scripts/*.sh (multiple scripts)
- extension.ts
The code I tried:
let startRuntime = vscode.commands.registerCommand('test.startRuntime', () => {
const scriptsPath = path.join(__filename, '..', 'scripts');
const scriptsDir = fs.readdirSync(scriptsPath);
scriptsDir.forEach((script) => {
const terminal = vscode.window.createTerminal(`${script}`);
terminal.show();
terminal.sendText(`./${script}`);
});
});
After running the extension a new VSCode instance starts and I want to execute the command. It actually starts as many terminals as i have scripts but in that instance on the terminals i get:
zsh: no such file or directory: ./test.sh
How do e.g other users who use the extension get access to those scripts.
Thank you in advance!