File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,10 +5,15 @@ var COMMITHASH_COMMAND = 'rev-parse HEAD'
55var VERSION_COMMAND = 'describe --always'
66
77function GitRevisionPlugin ( options ) {
8- this . gitWorkTree = options && options . gitWorkTree
9- this . lightweightTags = options && options . lightweightTags || false
10- this . commithashCommand = options && options . commithashCommand || COMMITHASH_COMMAND
11- this . versionCommand = options && options . versionCommand || VERSION_COMMAND
8+ options = options || { }
9+
10+ this . gitWorkTree = options . gitWorkTree
11+
12+ this . commithashCommand = options . commithashCommand ||
13+ COMMITHASH_COMMAND
14+
15+ this . versionCommand = options . versionCommand ||
16+ VERSION_COMMAND + ( options . lightweightTags ? ' --tags' : '' )
1217}
1318
1419GitRevisionPlugin . prototype . apply = function ( compiler ) {
@@ -21,7 +26,7 @@ GitRevisionPlugin.prototype.apply = function (compiler) {
2126
2227 buildFile ( compiler ,
2328 this . gitWorkTree ,
24- this . versionCommand + ( this . lightweightTags ? ' --tags' : '' ) ,
29+ this . versionCommand ,
2530 / \[ g i t - r e v i s i o n - v e r s i o n \] / gi,
2631 'VERSION'
2732 )
@@ -37,7 +42,7 @@ GitRevisionPlugin.prototype.commithash = function () {
3742GitRevisionPlugin . prototype . version = function ( ) {
3843 return runGitCommand (
3944 this . gitWorkTree ,
40- this . versionCommand + ( this . lightweightTags ? ' --tags' : '' )
45+ this . versionCommand
4146 )
4247}
4348
You can’t perform that action at this time.
0 commit comments