We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4b927a2 commit 3cc0577Copy full SHA for 3cc0577
build.gradle.kts
@@ -16,9 +16,12 @@ fun computeVersion(): String {
16
versionFile.readText().trim()
17
} else {
18
val gitVersion: groovy.lang.Closure<String> by extra
19
- val version = gitVersion()
20
- versionFile.writeText(version)
21
- version
+ gitVersion()
+ .let {
+ // Normalize the version so that is always a valid NPM version.
22
+ if (it.matches("""\d+\.\d+.\d+-.*""".toRegex())) it else "0.0.1-$it"
23
+ }
24
+ .also { versionFile.writeText(it) }
25
}
26
27
0 commit comments