Skip to content

Commit

Permalink
Switch from unmaintained child-process-promise to execa
Browse files Browse the repository at this point in the history
  • Loading branch information
koesie10 committed Nov 22, 2024
1 parent dba6718 commit 6e3497b
Show file tree
Hide file tree
Showing 5 changed files with 372 additions and 321 deletions.
22 changes: 13 additions & 9 deletions extensions/ql-vscode/gulpfile.ts/package.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { resolve } from "path";
import { deployPackage } from "./deploy";
import { spawn } from "child-process-promise";
import { spawn } from "cross-spawn";

export async function packageExtension(): Promise<void> {
const deployedPackage = await deployPackage();
Expand All @@ -16,16 +16,20 @@ export async function packageExtension(): Promise<void> {
`${deployedPackage.name}-${deployedPackage.version}.vsix`,
),
"--no-dependencies",
"--skip-license",
];
const proc = spawn(resolve(__dirname, "../node_modules/.bin/vsce"), args, {
const process = spawn(resolve(__dirname, "../node_modules/.bin/vsce"), args, {
cwd: deployedPackage.distPath,
});
proc.childProcess.stdout!.on("data", (data) => {
console.log(data.toString());
});
proc.childProcess.stderr!.on("data", (data) => {
console.error(data.toString());
stdio: ["ignore", "inherit", "inherit"],
});

await proc;
await new Promise((resolve, reject) => {
process.on("close", (code) => {
if (code === 0) {
resolve(undefined);
} else {
reject(new Error(`Failed to package extension with code ${code}`));
}
});
});
}
Loading

0 comments on commit 6e3497b

Please sign in to comment.