mirror of
https://github.com/codecov/codecov-action.git
synced 2026-04-13 09:30:05 +00:00
fix: create writestream before http call
This commit is contained in:
parent
0cb9213bc4
commit
affbcb165a
3 changed files with 6 additions and 20 deletions
13
src/index.ts
13
src/index.ts
|
|
@ -23,16 +23,10 @@ try {
|
|||
const platform = getPlatform(os);
|
||||
|
||||
const filename = path.join( __dirname, getUploaderName(platform));
|
||||
const filePath = fs.createWriteStream(filename);
|
||||
|
||||
https.get(getBaseUrl(platform, uploaderVersion), (res) => {
|
||||
// Image will be stored at this path
|
||||
|
||||
if (fs.existsSync(filename)) {
|
||||
core.info('IT EXISTS');
|
||||
} else {
|
||||
core.info('IT DOESNT EXIST');
|
||||
}
|
||||
|
||||
const filePath = fs.createWriteStream(filename);
|
||||
res.pipe(filePath);
|
||||
filePath
|
||||
.on('error', (err) => {
|
||||
core.info(`${console.trace()}`);
|
||||
|
|
@ -68,7 +62,6 @@ try {
|
|||
unlink();
|
||||
});
|
||||
});
|
||||
res.pipe(filePath);
|
||||
});
|
||||
} catch (err) {
|
||||
setFailure(`Codecov: Encountered an unexpected error ${err.message}`, failCi);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue