We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b5df97a commit 00e4d0fCopy full SHA for 00e4d0f
1 file changed
plugin-build/modulegraph/src/main/kotlin/dev/iurysouza/modulegraph/graph/Ext.kt
@@ -1,12 +1,15 @@
1
package dev.iurysouza.modulegraph.graph
2
3
-internal fun String.getProjectName(showFullPath: Boolean): String {
4
- return if (showFullPath) {
+internal fun String.getProjectName(
+ showFullPath: Boolean,
5
+): String = runCatching {
6
+ if (showFullPath) {
7
this
8
} else {
9
this.split(":").last { it.isNotBlank() }
10
}
-}
11
+}.getOrElse { this }
12
+
13
internal fun StringBuilder.lineBreak() {
14
append("\n")
15
0 commit comments