Files
2024-09-23 16:05:12 -07:00

22 lines
519 B
JavaScript

import { exec } from "node:child_process";
import { readdirSync } from "node:fs";
import { dirname } from "node:path";
process.chdir(dirname(import.meta.dirname));
let extPath;
for (const filename of readdirSync("extension")) {
if (filename.endsWith(".vsix")) {
extPath = `extension/${filename}`;
break;
}
}
if (!extPath) {
throw new Error("No .vsix file found");
}
exec(`code --new-window --install-extension=${extPath} --extensionDevelopmentPath=${process.cwd()} example`, {
stdio: "inherit",
});