mirror of
https://github.com/codecov/codecov-action.git
synced 2026-02-12 22:17:24 +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
11
dist/index.js
vendored
11
dist/index.js
vendored
|
|
@ -24596,15 +24596,9 @@ try {
|
||||||
const { execArgs, options, failCi, os, uploaderVersion, verbose } = src_buildExec();
|
const { execArgs, options, failCi, os, uploaderVersion, verbose } = src_buildExec();
|
||||||
const platform = getPlatform(os);
|
const platform = getPlatform(os);
|
||||||
const filename = external_path_.join(__dirname, getUploaderName(platform));
|
const filename = external_path_.join(__dirname, getUploaderName(platform));
|
||||||
|
const filePath = external_fs_.createWriteStream(filename);
|
||||||
external_https_.get(getBaseUrl(platform, uploaderVersion), (res) => {
|
external_https_.get(getBaseUrl(platform, uploaderVersion), (res) => {
|
||||||
// Image will be stored at this path
|
res.pipe(filePath);
|
||||||
if (external_fs_.existsSync(filename)) {
|
|
||||||
core.info('IT EXISTS');
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
core.info('IT DOESNT EXIST');
|
|
||||||
}
|
|
||||||
const filePath = external_fs_.createWriteStream(filename);
|
|
||||||
filePath
|
filePath
|
||||||
.on('error', (err) => {
|
.on('error', (err) => {
|
||||||
core.info(`${console.trace()}`);
|
core.info(`${console.trace()}`);
|
||||||
|
|
@ -24629,7 +24623,6 @@ try {
|
||||||
unlink();
|
unlink();
|
||||||
});
|
});
|
||||||
}));
|
}));
|
||||||
res.pipe(filePath);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
|
|
|
||||||
2
dist/index.js.map
vendored
2
dist/index.js.map
vendored
File diff suppressed because one or more lines are too long
13
src/index.ts
13
src/index.ts
|
|
@ -23,16 +23,10 @@ try {
|
||||||
const platform = getPlatform(os);
|
const platform = getPlatform(os);
|
||||||
|
|
||||||
const filename = path.join( __dirname, getUploaderName(platform));
|
const filename = path.join( __dirname, getUploaderName(platform));
|
||||||
|
const filePath = fs.createWriteStream(filename);
|
||||||
|
|
||||||
https.get(getBaseUrl(platform, uploaderVersion), (res) => {
|
https.get(getBaseUrl(platform, uploaderVersion), (res) => {
|
||||||
// Image will be stored at this path
|
res.pipe(filePath);
|
||||||
|
|
||||||
if (fs.existsSync(filename)) {
|
|
||||||
core.info('IT EXISTS');
|
|
||||||
} else {
|
|
||||||
core.info('IT DOESNT EXIST');
|
|
||||||
}
|
|
||||||
|
|
||||||
const filePath = fs.createWriteStream(filename);
|
|
||||||
filePath
|
filePath
|
||||||
.on('error', (err) => {
|
.on('error', (err) => {
|
||||||
core.info(`${console.trace()}`);
|
core.info(`${console.trace()}`);
|
||||||
|
|
@ -68,7 +62,6 @@ try {
|
||||||
unlink();
|
unlink();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
res.pipe(filePath);
|
|
||||||
});
|
});
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
setFailure(`Codecov: Encountered an unexpected error ${err.message}`, failCi);
|
setFailure(`Codecov: Encountered an unexpected error ${err.message}`, failCi);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue