File tree Expand file tree Collapse file tree 1 file changed +9
-11
lines changed
Expand file tree Collapse file tree 1 file changed +9
-11
lines changed Original file line number Diff line number Diff line change @@ -9,20 +9,18 @@ def getGitHubCommit = {
99 def changeOutput = new ByteArrayOutputStream ()
1010 def gitVersionName = " "
1111
12- execOperations. exec {
13- it. commandLine ' git' , ' rev-list' , ' --max-count=1' , ' HEAD'
14- it. standardOutput = hashOutput
15- }
12+ hashOutput = providers. exec {
13+ commandLine(' git' , ' rev-list' , ' --max-count=1' , ' HEAD' )
14+ }. standardOutput
1615
17- execOperations. exec {
18- it. commandLine ' git' , ' diff-index' , ' --shortstat' , ' HEAD'
19- it. standardOutput = changeOutput
20- }
16+ changeOutput = providers. exec {
17+ commandLine(' git' , ' diff-index' , ' --shortstat' , ' HEAD' )
18+ }. standardOutput
2119
22- gitVersionName = hashOutput. asText. get(). trim(). substring(0 , 7 )
23- if (! changeOutput. asText. get(). trim(). empty) {
20+ gitVersionName = hashOutput. asText() . get(). trim(). substring(0 , 7 )
21+ if (! changeOutput. asText() . get(). trim(). empty) {
2422 def pattern = Pattern . compile(" \\ d+" );
25- def matcher = pattern. matcher(changeOutput. asText. get(). trim())
23+ def matcher = pattern. matcher(changeOutput. asText() . get(). trim())
2624 if (matcher. find()) {
2725 gitVersionName + = " -" + matcher. group()
2826 }
You can’t perform that action at this time.
0 commit comments