fix: try it on open

This commit is contained in:
Tom Hu 2023-11-10 08:16:03 +11:00
parent 935e9cbb3b
commit 80a3090424
No known key found for this signature in database
GPG key ID: 79155678363963D2
3 changed files with 10 additions and 5 deletions

View file

@ -31,10 +31,13 @@ try {
} else {
core.info('IT DOESNT EXIST');
}
const filePath = fs.createWriteStream(filename);
res.pipe(filePath);
filePath
.on('error', (err) => {
.on('open', () => {
res.pipe(filePath);
}).on('error', (err) => {
core.info(`${fs.existsSync(filename)}`);
core.info(`${console.trace()}`);
core.info(`Stack: ${err.stack}`);
setFailure(