Skip to content

Commit 7bac92d

Browse files
committed
print debug message when finding branch
1 parent 19a9fd4 commit 7bac92d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/utils.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
const Promise = require('bluebird')
22
const { getGitBranch } = require('./git-api')
3+
const debug = require('debug')('commit-info')
34

45
function firstFoundValue (keys, object = process.env) {
56
const found = keys.find(key => {
@@ -20,8 +21,11 @@ function getBranch (pathToRepo) {
2021
]
2122
const ciBranch = firstFoundValue(ciNames, process.env)
2223
if (ciBranch) {
24+
debug('found branch %s from CI variable', ciBranch)
2325
return Promise.resolve(ciBranch)
2426
}
27+
debug('could not find branch from CI variables')
28+
debug('using Git tool to find branch')
2529
return getGitBranch(pathToRepo)
2630
}
2731

0 commit comments

Comments
 (0)