Skip to content

Commit

Permalink
Merge pull request #3839 from github/koesie10/switch-to-execa
Browse files Browse the repository at this point in the history
Remove unmaintained child-process-promise
  • Loading branch information
koesie10 authored Nov 25, 2024
2 parents 86f37f4 + 87a470d commit 5a3aeb6
Show file tree
Hide file tree
Showing 4 changed files with 211 additions and 364 deletions.
22 changes: 14 additions & 8 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, {
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) => {
proc.on("error", reject);

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

0 comments on commit 5a3aeb6

Please sign in to comment.