Skip to content

Commit

Permalink
Merge pull request #517 from avisi-cloud/fix-search-on-windows
Browse files Browse the repository at this point in the history
Fix search on Windows
  • Loading branch information
dirkgroot committed May 24, 2024
2 parents 7a88c72 + 363e6e1 commit ce2bd46
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 ce2bd46

Please sign in to comment.