mirror of
https://github.com/codecov/codecov-action.git
synced 2026-02-09 20:47:26 +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
11
dist/index.js
vendored
11
dist/index.js
vendored
|
|
@ -24596,14 +24596,19 @@ try {
|
|||
const { execArgs, options, failCi, os, uploaderVersion, verbose } = src_buildExec();
|
||||
const platform = getPlatform(os);
|
||||
const filename = external_path_.join(__dirname, getUploaderName(platform));
|
||||
const filePath = external_fs_.createWriteStream(filename);
|
||||
external_https_.get(getBaseUrl(platform, uploaderVersion), (res) => {
|
||||
const filePath = external_fs_.createWriteStream(filename);
|
||||
res.pipe(filePath);
|
||||
filePath
|
||||
.on('error', (err) => {
|
||||
core.info(`${console.trace()}`);
|
||||
core.info(`Stack: ${err.stack}`);
|
||||
if (external_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', () => src_awaiter(void 0, void 0, void 0, function* () {
|
||||
filePath.close();
|
||||
yield validate(filename, platform, uploaderVersion, verbose, failCi);
|
||||
|
|
|
|||
2
dist/index.js.map
vendored
2
dist/index.js.map
vendored
File diff suppressed because one or more lines are too long
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…
Reference in a new issue