Skip to content

Commit

Permalink
Redirect toolExists process output to /dev/null
Browse files Browse the repository at this point in the history
  • Loading branch information
NobodyXu authored Jun 15, 2024
1 parent 3642f3e commit cef8ea2
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,14 @@ async function execAndSucceed(
async function toolExists(name: string): Promise<boolean> {
try {
debug(`running "${name} --help"`);
const code = await _exec(name, ['--help']);
const code = await _exec(
name,
['--help'],
{
outStream: fs.createWriteStream('/dev/null'),

Check failure on line 470 in src/main.ts

View workflow job for this annotation

GitHub Actions / check-dist

Property 'createWriteStream' does not exist on type 'typeof import("node:fs/promises")'.
errStream: fs.createWriteStream('/dev/null'),

Check failure on line 471 in src/main.ts

View workflow job for this annotation

GitHub Actions / check-dist

Property 'createWriteStream' does not exist on type 'typeof import("node:fs/promises")'.
},
);
debug(`program exited with code ${code}`);
return code === 0;
} catch (err) {
Expand Down

0 comments on commit cef8ea2

Please sign in to comment.