From 363e6e1ee0069f8979d35ea95498a64921c2bb96 Mon Sep 17 00:00:00 2001 From: Dirk Groot Date: Tue, 21 May 2024 09:21:18 +0200 Subject: [PATCH] Try to fix search on Windows Using the same API's that were used in #483 to fix #463. --- .../structurizr/site/generatr/site/RelativeUrl.kt | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/main/kotlin/nl/avisi/structurizr/site/generatr/site/RelativeUrl.kt b/src/main/kotlin/nl/avisi/structurizr/site/generatr/site/RelativeUrl.kt index 01c57879..75d45f0f 100644 --- a/src/main/kotlin/nl/avisi/structurizr/site/generatr/site/RelativeUrl.kt +++ b/src/main/kotlin/nl/avisi/structurizr/site/generatr/site/RelativeUrl.kt @@ -1,12 +1,11 @@ package nl.avisi.structurizr.site.generatr.site -import java.nio.file.Path -import kotlin.io.path.relativeTo +import java.io.File fun String.asUrlToDirectory(otherUrl: String) = "${this.asUrlToFile(otherUrl)}/" -fun String.asUrlToFile(otherUrl: String) = - if (otherUrl == this) "." - else Path.of(this) - .relativeTo(Path.of(otherUrl)).toString() - +fun String.asUrlToFile(relativeTo: String): String = + if (relativeTo == this) "." + else File(this) + .relativeTo(File(relativeTo)) + .toString()