blob: 6e890c42080574a90e6437ab85fc4d5db20d461b (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
import { readdirSync } from "node:fs";
import { spawn } from "node:child_process";
const { pathname } = new URL("..", import.meta.url);
process.chdir(pathname);
let path;
for (const filename of readdirSync("extension")) {
if (filename.endsWith(".vsix")) {
path = `extension/${filename}`;
break;
}
}
if (!path) {
throw new Error("No .vsix file found");
}
spawn("code", ["--new-window", `--install-extension=${path}`, `--extensionDevelopmentPath=${pathname}`, "example"], {
stdio: "inherit",
});
|