Skip to content

Commit 5a3aeb6

Browse files
authored
Merge pull request #3839 from github/koesie10/switch-to-execa
Remove unmaintained child-process-promise
2 parents 86f37f4 + 87a470d commit 5a3aeb6

File tree

4 files changed

+211
-364
lines changed

4 files changed

+211
-364
lines changed
Lines changed: 14 additions & 8 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 "cross-spawn";
44

55
export async function packageExtension(): Promise<void> {
66
const deployedPackage = await deployPackage();
@@ -16,16 +16,22 @@ export async function packageExtension(): Promise<void> {
1616
`${deployedPackage.name}-${deployedPackage.version}.vsix`,
1717
),
1818
"--no-dependencies",
19+
"--skip-license",
1920
];
2021
const proc = 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+
proc.on("error", reject);
28+
29+
proc.on("close", (code) => {
30+
if (code === 0) {
31+
resolve(undefined);
32+
} else {
33+
reject(new Error(`Failed to package extension with code ${code}`));
34+
}
35+
});
36+
});
3137
}

0 commit comments

Comments
 (0)