Skip to content

Commit a0ef72d

Browse files
authored
Fix
1 parent cef8ea2 commit a0ef72d

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/main.ts

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import {promises as fs} from 'fs';
22
import {join, normalize, resolve} from 'path';
3+
import * as stream from 'stream'
34

45
import {
56
setFailed,
@@ -450,6 +451,11 @@ function render(template: string, vars: TemplateVars): string {
450451
return _render(template, vars);
451452
}
452453

454+
async function openDevNullWritable(): Promise<stream.Writable> {
455+
const file = await fs.open("/dev/null");
456+
return file.createWriteStream();
457+
}
458+
453459
async function execAndSucceed(
454460
program: string,
455461
args: string[],
@@ -467,8 +473,8 @@ async function toolExists(name: string): Promise<boolean> {
467473
name,
468474
['--help'],
469475
{
470-
outStream: fs.createWriteStream('/dev/null'),
471-
errStream: fs.createWriteStream('/dev/null'),
476+
outStream: await openDevNullWritable(),
477+
errStream: await openDevNullWritable(),
472478
},
473479
);
474480
debug(`program exited with code ${code}`);

0 commit comments

Comments
 (0)