From 77539422a11817e6cbd75cceb4119b5f84b5bfb7 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Fri, 17 May 2019 13:53:04 +0200 Subject: [PATCH] Fixed need for bash --- app/build.gradle | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index a6de6d2c0..6eaf1a521 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -27,16 +27,14 @@ task getGitVersion() { def gitVersion = "4.1" def gitVersionStream = new ByteArrayOutputStream() - def result = exec { - def command = "git describe --always" - ignoreExitValue = true - executable "bash" args "-l", "-c", command - standardOutput = gitVersionStream - } - if (result.getExitValue() == 0) { + try { + exec { + executable "git" args "describe", "--always" + standardOutput = gitVersionStream + } gitVersion = gitVersionStream.toString().trim() println("Git version: " + gitVersion) - } else { + } catch (Exception e) { println("Git not found") } project.version = gitVersion