Skip to content

Commit 71dccc0

Browse files
authored
Merge pull request #7 from robertleib/allow-custom-git-command
allow custom git commithash commands"
2 parents 63fb079 + 35e15f9 commit 71dccc0

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

lib/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,16 @@ var versionCommand = 'describe --always'
77
function GitRevisionPlugin (options) {
88
this.gitWorkTree = options && options.gitWorkTree
99
this.lightweightTags = options && options.lightweightTags || false
10+
this.commithashCommand = options && options.commithashCommand || commithashCommand
1011
}
1112

1213
GitRevisionPlugin.prototype.apply = function (compiler) {
13-
buildFile(compiler, this.gitWorkTree, commithashCommand, /\[git-revision-hash\]/gi, 'COMMITHASH')
14+
buildFile(compiler, this.gitWorkTree, this.commithashCommand, /\[git-revision-hash\]/gi, 'COMMITHASH')
1415
buildFile(compiler, this.gitWorkTree, versionCommand + (this.lightweightTags ? ' --tags' : ''), /\[git-revision-version\]/gi, 'VERSION')
1516
}
1617

1718
GitRevisionPlugin.prototype.commithash = function (callback) {
18-
return runGitCommand(this.gitWorkTree, commithashCommand)
19+
return runGitCommand(this.gitWorkTree, this.commithashCommand)
1920
}
2021

2122
GitRevisionPlugin.prototype.version = function (callback) {

0 commit comments

Comments
 (0)