|
15 | 15 | }); |
16 | 16 |
|
17 | 17 | program |
18 | | - .version('0.1.0') |
| 18 | + .version('1.0.4') |
19 | 19 | .usage('[options]') |
20 | 20 | .option('-f, --format [value]', 'Coverage input format') |
21 | | - .option('-t, --token [value]', 'Set Token') |
22 | | - .option('-c, --commit [value]', 'Set Commit Id') |
23 | | - .option('-e, --endpoint [value]', 'Set Endpoint') |
| 21 | + .option('-t, --token [value]', 'Codacy Project API Token') |
| 22 | + .option('-c, --commit [value]', 'Commit SHA hash') |
| 23 | + .option('-e, --endpoint [value]', 'Codacy API Endpoint') |
| 24 | + .option('-p, --prefix [value]', 'Project path prefix') |
24 | 25 | .option('-v, --verbose', 'Display verbose output') |
25 | 26 | .option('-d, --debug', 'Display debug output') |
26 | 27 | .parse(process.argv); |
|
30 | 31 | debug: program.debug |
31 | 32 | }); |
32 | 33 |
|
33 | | - loggerImpl.info(util.format('Started with: token [%j], commitId [%j], endpoint [%j], format [%j], verbose [%j], debug [%j]', program.token, program.commit, program.endpoint, program.format, program.verbose, program.debug)); |
| 34 | + loggerImpl.info(util.format('Started with: token [%j], commitId [%j], endpoint [%j], format [%j], path prefix [%j], verbose [%j], debug [%j]', |
| 35 | + program.token, program.commit, program.endpoint, program.format, program.prefix, program.verbose, program.debug)); |
34 | 36 |
|
35 | 37 | process.stdin.on('end', function () { |
36 | 38 | loggerImpl.trace('Received file through stdin'); |
|
41 | 43 |
|
42 | 44 | var token = program.token || process.env.CODACY_REPO_TOKEN, |
43 | 45 | commitId = program.commit, |
44 | | - format = program.format || 'lcov'; |
| 46 | + format = program.format || 'lcov', |
| 47 | + pathPrefix = program.prefix || ''; |
45 | 48 |
|
46 | 49 | if (!token) { |
47 | 50 | return loggerImpl.error(new Error('Token is required')); |
48 | 51 | } |
49 | 52 |
|
50 | 53 | // Parse the coverage data for the given format and retrieve the commit id if we don't have it. |
51 | | - return Q.all([lib.getParser(format).parse(input), getGitData.getCommitId(commitId)]).spread(function (parsedCoverage, commitId) { |
| 54 | + return Q.all([lib.getParser(format).parse(pathPrefix, input), getGitData.getCommitId(commitId)]).spread(function (parsedCoverage, commitId) { |
52 | 55 | // Now that we've parse the coverage data to the correct format, send it to Codacy. |
53 | 56 | loggerImpl.trace(parsedCoverage); |
54 | 57 | lib.reporter({ |
|
0 commit comments