mirror of
https://github.com/codecov/codecov-action.git
synced 2026-02-17 16:31:45 +00:00
catch
This commit is contained in:
parent
9429a7b9ad
commit
dd1d2966f2
2 changed files with 10 additions and 10 deletions
8
dist/index.js
vendored
8
dist/index.js
vendored
|
|
@ -14704,10 +14704,7 @@ var superagent = __nccwpck_require__(1524);
|
||||||
// const {failCi} = buildExec();
|
// const {failCi} = buildExec();
|
||||||
try {
|
try {
|
||||||
var filename_1 = __dirname + '/uploader';
|
var filename_1 = __dirname + '/uploader';
|
||||||
superagent.get('https://uploader.codecov.io/latest/codecov-linux')["catch"]('error', function (err) {
|
superagent.get('https://uploader.codecov.io/latest/codecov-linux')
|
||||||
core.setFailed('Codecov: Could not properly download uploader binary: ' +
|
|
||||||
("" + err.message));
|
|
||||||
})
|
|
||||||
.pipe(fs.createWriteStream(filename_1))
|
.pipe(fs.createWriteStream(filename_1))
|
||||||
.then(function (err, res) {
|
.then(function (err, res) {
|
||||||
fs.chmodSync(filename_1, '777');
|
fs.chmodSync(filename_1, '777');
|
||||||
|
|
@ -14724,6 +14721,9 @@ try {
|
||||||
.then(function () {
|
.then(function () {
|
||||||
console.log('finished!');
|
console.log('finished!');
|
||||||
});
|
});
|
||||||
|
})["catch"](function (err) {
|
||||||
|
core.setFailed('Codecov: Could not properly download uploader binary: ' +
|
||||||
|
("" + err.message));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
|
|
|
||||||
12
src/index.ts
12
src/index.ts
|
|
@ -12,12 +12,6 @@ const superagent = require('superagent');
|
||||||
try {
|
try {
|
||||||
const filename = __dirname + '/uploader';
|
const filename = __dirname + '/uploader';
|
||||||
superagent.get('https://uploader.codecov.io/latest/codecov-linux')
|
superagent.get('https://uploader.codecov.io/latest/codecov-linux')
|
||||||
.catch('error', (err) => {
|
|
||||||
core.setFailed(
|
|
||||||
'Codecov: Could not properly download uploader binary: ' +
|
|
||||||
`${err.message}`,
|
|
||||||
);
|
|
||||||
})
|
|
||||||
.pipe(fs.createWriteStream(filename))
|
.pipe(fs.createWriteStream(filename))
|
||||||
.then((err, res) => {
|
.then((err, res) => {
|
||||||
fs.chmodSync(filename, '777');
|
fs.chmodSync(filename, '777');
|
||||||
|
|
@ -37,6 +31,12 @@ try {
|
||||||
.then(() => {
|
.then(() => {
|
||||||
console.log('finished!');
|
console.log('finished!');
|
||||||
});
|
});
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
core.setFailed(
|
||||||
|
'Codecov: Could not properly download uploader binary: ' +
|
||||||
|
`${err.message}`,
|
||||||
|
);
|
||||||
});
|
});
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
core.setFailed(
|
core.setFailed(
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue