Skip to content

Commit

Permalink
Remove unmaintained child-process-promise
Browse files Browse the repository at this point in the history
  • Loading branch information
koesie10 committed Nov 22, 2024
1 parent dba6718 commit f3e9103
Show file tree
Hide file tree
Showing 4 changed files with 208 additions and 365 deletions.
24 changes: 15 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,22 @@ 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("error", 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 f3e9103

Please sign in to comment.