Fix Index Out of Bounds

This commit is contained in:
Josh Cummings 2022-10-17 14:52:03 -06:00
parent ff055cf07a
commit 89c815032c
No known key found for this signature in database
GPG Key ID: A306A51F43B8E5A5
1 changed files with 3 additions and 1 deletions

View File

@ -38,7 +38,9 @@ tasks.register('generateAntora') {
.join('\n')
def outputFile = layout.buildDirectory.file('generateAntora/antora.yml').get().asFile
mkdir(outputFile.getParentFile())
def (mainVersion, prerelease) = project.version.split(/(?=-)/, 2)
def components = project.version.split(/(?=-)/)
def mainVersion = components[0];
def prerelease = components.length > 1 ? components[1] : null
def antoraYmlText = file('antora.yml').text
layout.buildDirectory.file('.antora.yml').get().asFile.text = antoraYmlText
antoraYmlText = antoraYmlText.lines().collect { l ->