Skip to content
This repository was archived by the owner on Jan 10, 2023. It is now read-only.

Commit 4a7561e

Browse files
Steve Peakeddiemoore
authored andcommitted
add -X s3 to disable uploading to s3 (#84)
1 parent 19facba commit 4a7561e

File tree

1 file changed

+21
-15
lines changed

1 file changed

+21
-15
lines changed

lib/codecov.js

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -382,21 +382,27 @@ var upload = function(args, on_success, on_failure){
382382

383383
} else {
384384
console.log('==> Uploading reports');
385-
sendToCodecovV3(codecov_endpoint, query, upload,
386-
function(){
387-
// remove files after Uploading
388-
if (args.options.clear) {
389-
for (var i = files.length - 1; i >= 0; i--) {
390-
try {
391-
fs.unlinkSync(files[i]);
392-
} catch (e) {}
393-
}
394-
}
395-
if (on_success) {
396-
on_success.apply(this, arguments);
397-
}
398-
},
399-
on_failure || function(){});
385+
var _upload;
386+
if ((args.options.disable || '').split(',').indexOf('s3') === -1) {
387+
_upload = sendToCodecovV3;
388+
} else {
389+
_upload = sendToCodecovV2;
390+
}
391+
_upload(codecov_endpoint, query, upload,
392+
function(){
393+
// remove files after Uploading
394+
if (args.options.clear) {
395+
for (var i = files.length - 1; i >= 0; i--) {
396+
try {
397+
fs.unlinkSync(files[i]);
398+
} catch (e) {}
399+
}
400+
}
401+
if (on_success) {
402+
on_success.apply(this, arguments);
403+
}
404+
},
405+
on_failure || function(){});
400406
}
401407
}
402408

0 commit comments

Comments
 (0)