fix: on open

This commit is contained in:
Tom Hu 2023-11-10 10:30:58 +11:00
parent 96c10b3f72
commit fc784079cb
No known key found for this signature in database
GPG key ID: 79155678363963D2
3 changed files with 7 additions and 5 deletions

View file

@ -26,9 +26,10 @@ try {
https.get(getBaseUrl(platform, uploaderVersion), (res) => {
const filePath = fs.createWriteStream(filename);
res.pipe(filePath);
filePath
.on('error', (err) => {
.on('open', () => {
res.pipe(filePath);
}).on('error', (err) => {
if (fs.existsSync(filename)) {
core.info('IT EXISTS');
} else {