Fixed need for bash
This commit is contained in:
parent
9e0a441896
commit
77539422a1
1 changed files with 6 additions and 8 deletions
|
@ -27,16 +27,14 @@ task getGitVersion() {
|
||||||
def gitVersion = "4.1"
|
def gitVersion = "4.1"
|
||||||
def gitVersionStream = new ByteArrayOutputStream()
|
def gitVersionStream = new ByteArrayOutputStream()
|
||||||
|
|
||||||
def result = exec {
|
try {
|
||||||
def command = "git describe --always"
|
exec {
|
||||||
ignoreExitValue = true
|
executable "git" args "describe", "--always"
|
||||||
executable "bash" args "-l", "-c", command
|
standardOutput = gitVersionStream
|
||||||
standardOutput = gitVersionStream
|
}
|
||||||
}
|
|
||||||
if (result.getExitValue() == 0) {
|
|
||||||
gitVersion = gitVersionStream.toString().trim()
|
gitVersion = gitVersionStream.toString().trim()
|
||||||
println("Git version: " + gitVersion)
|
println("Git version: " + gitVersion)
|
||||||
} else {
|
} catch (Exception e) {
|
||||||
println("Git not found")
|
println("Git not found")
|
||||||
}
|
}
|
||||||
project.version = gitVersion
|
project.version = gitVersion
|
||||||
|
|
Loading…
Reference in a new issue