From d6755010d674b5148fcaa582088b0309e39ed40d Mon Sep 17 00:00:00 2001 From: AVVS Date: Sat, 20 Oct 2018 19:41:47 -0700 Subject: [PATCH] fix: dynamic coverage command --- bin/cmds/test.js | 5 +++-- bin/cmds/test_cmds/run.js | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/bin/cmds/test.js b/bin/cmds/test.js index c360fd2..b315b7a 100644 --- a/bin/cmds/test.js +++ b/bin/cmds/test.js @@ -78,8 +78,9 @@ exports.builder = yargs => ( }) .option('coverage', { describe: 'whether to upload coverage or not', - boolean: true, - default: !!process.env.CI, + default: process.env.CI === 'true' + ? './node_modules/.bin/codecov' + : false, }) .option('root', { describe: 'binary root path on the tester', diff --git a/bin/cmds/test_cmds/run.js b/bin/cmds/test_cmds/run.js index e99f98f..41749d2 100644 --- a/bin/cmds/test_cmds/run.js +++ b/bin/cmds/test_cmds/run.js @@ -102,6 +102,6 @@ exports.handler = async (argv) => { // upload codecoverage report if (argv.coverage) { // this is to avoid exposing token - await echoAndExec('./node_modules/.bin/codecov > /dev/null &2>1'); + await echoAndExec(`${argv.coverage} > /dev/null 2>1`); } };