From e460475592a785388a17207502ef3166a37b5592 Mon Sep 17 00:00:00 2001 From: Friedrich von Never Date: Wed, 28 Feb 2024 00:07:43 +0100 Subject: [PATCH] Plugin publication: fix the channel selector Before this patch, publisher was always using the channel corresponding to the first number in the plugin version for release builds. This is because by default, Kotlin's substringAfter will return the whole input string if it's unable to find the needle. --- build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index 7b867e7..c5e5958 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -126,6 +126,6 @@ tasks { // The pluginVersion is based on the SemVer (https://semver.org) and supports pre-release labels, like 2.1.7-alpha.3 // Specify pre-release label to publish the plugin in a custom Release Channel automatically. Read more: // https://plugins.jetbrains.com/docs/intellij/deployment.html#specifying-a-release-channel - channels = properties("pluginVersion").map { listOf(it.substringAfter('-').substringBefore('.').ifEmpty { "default" }) } + channels = properties("pluginVersion").map { listOf(it.substringAfter('-', "").substringBefore('.').ifEmpty { "default" }) } } }