Skip to content

Commit

Permalink
Try to fix search on Windows
Browse files Browse the repository at this point in the history
Using the same API's that were used in #483 to fix #463.
  • Loading branch information
dirkgroot committed May 21, 2024
1 parent 727f5c5 commit 363e6e1
Showing 1 changed file with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -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()

0 comments on commit 363e6e1

Please sign in to comment.