runa/vscode/scripts/install-local.cjs

18 lines
657 B
JavaScript
Raw Normal View History

const { spawnSync } = require("node:child_process");
const { resolve } = require("node:path");
const command = process.env.VSCODE_CLI || "code";
const result = spawnSync(
command,
["--install-extension", resolve(__dirname, "../runa.vsix"), "--force"],
{ stdio: "inherit" },
);
if (result.error) {
console.error(`Could not run ${command}: ${result.error.message}`);
console.error("Set VSCODE_CLI to the VS Code CLI executable if it is not on PATH.");
process.exitCode = 1;
} else if (result.status !== 0) {
console.error(`VS Code extension installation failed (${result.signal || result.status}).`);
process.exitCode = result.status || 1;
}