Skip to content

Commit

Permalink
Fix compiling with absolute paths.
Browse files Browse the repository at this point in the history
  • Loading branch information
thane98 committed Sep 3, 2020
1 parent 2669b66 commit fff34de
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main/kotlin/com/thane98/exalt/compiler/SourceManager.kt
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ class SourceManager {
}

private fun findSource(pathString: String): Path {
val absolutePath = Paths.get(pathString)
if (absolutePath.isAbsolute && Files.exists(absolutePath)) {
return absolutePath
}
for (path in searchPaths) {
val target = Paths.get("$path/$pathString")
if (Files.exists(target) && !Files.isDirectory(target))
Expand Down

0 comments on commit fff34de

Please sign in to comment.