Skip to content

Commit 82beea8

Browse files
committed
Fix failure on first commit
1 parent 291c32e commit 82beea8

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

index.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,18 @@ function diff() {
2626

2727
function transform(tree, file, next) {
2828
var base = file.dirname;
29-
var range = process.env.TRAVIS_COMMIT_RANGE;
29+
var commitRange = process.env.TRAVIS_COMMIT_RANGE;
30+
var range = (commitRange || '').split(/\.{3}/);
3031

31-
if (!base || !range) {
32+
if (!base || !commitRange || range.length !== 2) {
3233
return next();
3334
}
3435

35-
if (range !== previousRange) {
36+
if (commitRange !== previousRange) {
3637
cache = {};
37-
previousRange = range;
38+
previousRange = commitRange;
3839
}
3940

40-
range = range.split(/\.{3}/);
41-
4241
if (has(cache, base)) {
4342
tick(cache[base]);
4443
} else {

0 commit comments

Comments
 (0)