Skip to content
This repository was archived by the owner on Apr 24, 2018. It is now read-only.

Commit 905b29b

Browse files
committed
Fix release script again
1 parent 9e23ab3 commit 905b29b

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

release.gradle

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,11 @@ showcaseViewRelease.dependsOn('library:uploadArchives')
99
showcaseViewRelease.finalizedBy('commitRelease')
1010

1111
task commitRelease(type: Exec) {
12-
commandLine 'git', "commit", "README.md", "-m", "Update to version " + (project.hasProperty("versionName") ? project.property("versionName") : "")
13-
}
14-
commitRelease.doLast {
15-
if (!project.hasProperty("versionName")) {
16-
println("Sad face");
17-
}
12+
commandLine 'git', "commit", "README.md", "-m", "Update to version " + getVersionName()
1813
}
1914

2015
task createGithubRelease(type: Exec) {
16+
def versionName = getVersionName()
2117
def jsonData = JsonOutput.toJson([
2218
tag_name: "v$versionName",
2319
name : "v$versionName",
@@ -37,3 +33,12 @@ task editReadme(type: Copy) {
3733
}
3834
into '.'
3935
}
36+
37+
def getVersionName() {
38+
if (project.hasProperty("versionName")) {
39+
return project.property("versionName")
40+
} else {
41+
println("using default version no.")
42+
return ""
43+
}
44+
}

0 commit comments

Comments
 (0)