mirror of
https://github.com/codecov/codecov-action.git
synced 2026-04-13 09:30:05 +00:00
fix: does the file exist?
This commit is contained in:
parent
affbcb165a
commit
4ec3acecb4
3 changed files with 16 additions and 7 deletions
10
src/index.ts
10
src/index.ts
|
|
@ -23,18 +23,22 @@ try {
|
|||
const platform = getPlatform(os);
|
||||
|
||||
const filename = path.join( __dirname, getUploaderName(platform));
|
||||
const filePath = fs.createWriteStream(filename);
|
||||
|
||||
https.get(getBaseUrl(platform, uploaderVersion), (res) => {
|
||||
const filePath = fs.createWriteStream(filename);
|
||||
res.pipe(filePath);
|
||||
filePath
|
||||
.on('error', (err) => {
|
||||
core.info(`${console.trace()}`);
|
||||
core.info(`Stack: ${err.stack}`);
|
||||
if (fs.existsSync(filename)) {
|
||||
core.info('IT EXISTS');
|
||||
} else {
|
||||
core.info('IT DOESNT EXIST');
|
||||
}
|
||||
setFailure(
|
||||
`Codecov:Failed to write uploader binary: ${err.message}\n${err}`,
|
||||
true,
|
||||
);
|
||||
core.info(`${console.trace()}`);
|
||||
}).on('finish', async () => {
|
||||
filePath.close();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue