mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 12:23:58 +01:00
* Added try-catch block in getBuildVersion function in gitutils.gradle file. * Formatting fix * Add comment
This commit is contained in:
parent
bedc53b0ca
commit
7b2f7191f5
1 changed files with 10 additions and 5 deletions
|
|
@ -1,10 +1,15 @@
|
|||
ext.getBuildVersion = { ->
|
||||
def stdout = new ByteArrayOutputStream()
|
||||
exec {
|
||||
commandLine 'git', 'rev-parse', '--short', 'HEAD'
|
||||
standardOutput = stdout
|
||||
// Short-term fix for #1157. Should ideally look into why method is failing.
|
||||
try {
|
||||
def stdout = new ByteArrayOutputStream()
|
||||
exec {
|
||||
commandLine 'git' , 'rev-parse' , '--short' , 'HEAD'
|
||||
standardOutput = stdout
|
||||
}
|
||||
return stdout.toString().trim()
|
||||
} catch (ignored) {
|
||||
return null
|
||||
}
|
||||
return stdout.toString().trim()
|
||||
}
|
||||
|
||||
ext.getBranchName = { ->
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue