Skip to content

Commit 039f2fc

Browse files
committed
1.1.9
- fixes environment overrides for CI
1 parent a08fe83 commit 039f2fc

File tree

5 files changed

+26
-20
lines changed

5 files changed

+26
-20
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 1.1.9 (10/27/2017)
2+
3+
- fixes environment overrides for CI
4+
15
# 1.1.8 (10/27/2017)
26

37
- fixes coverage api to sort before limit is run

dist/bundle.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/ci.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ module.exports = function() {
3030
options.service_pull_request = process.env.TRAVIS_PULL_REQUEST;
3131
options.commit = 'HEAD';
3232
options.message = process.env.TRAVIS_COMMIT_MESSAGE;
33-
options.branch = process.env.TRAVIS_BRANCH || process.env.TRAVIS_PULL_REQUEST_BRANCH;
33+
options.branch = process.env.TRAVIS_BRANCH || process.env.TRAVIS_PULL_REQUEST_BRANCH || process.env.TRAVIS_TAG;
3434
}
3535

3636
if (process.env.DRONE){

lib/cli.js

+19-17
Original file line numberDiff line numberDiff line change
@@ -16,53 +16,55 @@ module.exports = function cli({ parser, input, url, basePath }) {
1616
const parsedUrl = Url.parse(url);
1717

1818
return new Promise(async function(resolve, reject) {
19+
const info = await git.parse();
1920
const env = ci();
2021
const output = {
2122
service_job_id: env.service_job_id,
2223
service_pull_request: env.service_pull_request,
2324
service_name: env.service_name,
2425
source_files: [],
2526
git: {
26-
commit: env.commit,
27-
branch: env.branch,
28-
message: env.message,
29-
committer_name: env.committer_name,
30-
committer_email: env.committer_email
27+
author_date: info.author_date,
28+
author_email: info.author_email,
29+
author_name: info.author_name,
30+
committer_date: info.committer_date,
31+
commit: env.commit || info.commit,
32+
branch: env.branch || info.branch,
33+
message: env.message || info.message,
34+
committer_name: env.committer_name || info.committer_name,
35+
committer_email: env.committer_email || info.committer_email,
36+
remotes: info.remotes
3137
},
3238
run_at: new Date()
3339
};
3440

35-
let _lcov = {};
3641
switch(parser) {
3742
case 'cobertura':
38-
_lcov = await cobertura.parse(input);
43+
output['source_files'] = await cobertura.parse(input);
3944
break;
4045
case 'golang':
41-
_lcov = await golang.parse(input);
46+
output['source_files'] = await golang.parse(input);
4247
break;
4348
case 'jacoco':
44-
_lcov = await jacoco.parse(input);
49+
output['source_files'] = await jacoco.parse(input);
4550
break;
4651
default:
47-
_lcov = await lcov.parse(input);
52+
output['source_files'] = await lcov.parse(input);
4853
break;
4954
}
5055

5156
// Go through and set the file contents
52-
for (let i = 0; i < _lcov.length; i++) {
53-
let path = basePath ? Path.resolve(process.cwd(), basePath, _lcov[i].file) : _lcov[i].file;
57+
for (let i = 0; i < output['source_files'].length; i++) {
58+
let path = basePath ? Path.resolve(process.cwd(), basePath, output['source_files'][i].file) : output['source_files'][i].file;
5459

5560
if(fs.existsSync(path)) {
56-
_lcov[i].source = fs.readFileSync(path).toString('utf8');
57-
_lcov[i].title = _lcov[i].file.substring(_lcov[i].file.lastIndexOf('/') + 1, _lcov[i].file.length);
61+
output['source_files'][i].source = fs.readFileSync(path).toString('utf8');
62+
output['source_files'][i].title = output['source_files'][i].file.substring(output['source_files'][i].file.lastIndexOf('/') + 1, output['source_files'][i].file.length);
5863
} else {
5964
return reject(`can not find file at ${path}`);
6065
}
6166
}
6267

63-
output['source_files'] = _lcov;
64-
output['git'] = Object.assign(output['git'], await git.parse());
65-
6668
const options = {
6769
hostname: parsedUrl.hostname,
6870
port: parsedUrl.port || 80,

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "lcov-server",
3-
"version": "1.1.8",
3+
"version": "1.1.9",
44
"description": "🎯 A simple lcov server & cli parser",
55
"main": "index.js",
66
"homepage": "https://github.com/gabrielcsapo/lcov-server#readme",

0 commit comments

Comments
 (0)