From ea97b3068ac0bb4ea1233280f7a9c14c426fb8ff Mon Sep 17 00:00:00 2001 From: simov Date: Fri, 13 May 2016 11:34:04 +0300 Subject: [PATCH] Detect config file in the root folder --- lib/codecov.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/codecov.js b/lib/codecov.js index 8b9da9a9..b9d33a19 100644 --- a/lib/codecov.js +++ b/lib/codecov.js @@ -1,4 +1,5 @@ var fs = require('fs'); +var path = require('path'); var request = require('request'); var urlgrey = require('urlgrey'); var execSync = require('child_process').execSync; @@ -158,6 +159,10 @@ var upload = function(args, on_success, on_failure){ ' \\_____\\___/ \\__,_|\\___|\\___\\___/ \\_/ \n' + ' ' + version); + query.yaml = ['codecov.yml', '.codecov.yml'].reduce(function (result, file) { + return result || (fs.existsSync(path.resolve(process.cwd(), file)) ? file : undefined) + }, undefined) + if ((args.options.disable || '').split(',').indexOf('detect') === -1) { console.log('==> Detecting CI Provider'); query = detectProvider();