Skip to content

Commit 86a081b

Browse files
committed
Switch from unmaintained child-process-promise to execa
1 parent dba6718 commit 86a081b

File tree

4 files changed

+421
-124
lines changed

4 files changed

+421
-124
lines changed
Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { resolve } from "path";
22
import { deployPackage } from "./deploy";
3-
import { spawn } from "child-process-promise";
3+
import { spawn } from "node:child_process";
44

55
export async function packageExtension(): Promise<void> {
66
const deployedPackage = await deployPackage();
@@ -16,16 +16,20 @@ export async function packageExtension(): Promise<void> {
1616
`${deployedPackage.name}-${deployedPackage.version}.vsix`,
1717
),
1818
"--no-dependencies",
19+
"--skip-license",
1920
];
20-
const proc = spawn(resolve(__dirname, "../node_modules/.bin/vsce"), args, {
21+
const process = spawn(resolve(__dirname, "../node_modules/.bin/vsce"), args, {
2122
cwd: deployedPackage.distPath,
22-
});
23-
proc.childProcess.stdout!.on("data", (data) => {
24-
console.log(data.toString());
25-
});
26-
proc.childProcess.stderr!.on("data", (data) => {
27-
console.error(data.toString());
23+
stdio: ["ignore", "inherit", "inherit"],
2824
});
2925

30-
await proc;
26+
await new Promise((resolve, reject) => {
27+
process.on("close", (code) => {
28+
if (code === 0) {
29+
resolve(undefined);
30+
} else {
31+
reject(new Error(`Failed to package extension with code ${code}`));
32+
}
33+
});
34+
});
3135
}

0 commit comments

Comments
 (0)