mirror of
https://github.com/oven-sh/bun
synced 2026-02-02 15:08:46 +00:00
26 lines
649 B
JavaScript
26 lines
649 B
JavaScript
import { exec } from "node:child_process";
|
|
import { readdirSync } from "node:fs";
|
|
import path from "node:path";
|
|
|
|
let { pathname } = new URL("..", import.meta.url);
|
|
if (process.platform === "win32") {
|
|
pathname = path.normalize(pathname).substring(1); // remove leading slash
|
|
}
|
|
process.chdir(pathname);
|
|
|
|
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=${path} --extensionDevelopmentPath=${pathname} example`, {
|
|
stdio: "inherit",
|
|
});
|