Skip to content

Commit

Permalink
fix checking for directory in defaultExists
Browse files Browse the repository at this point in the history
  • Loading branch information
alterationx10 committed Dec 29, 2024
1 parent 57b2c6e commit 01e1d94
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ case class FileContextHandler(
}

private[spider] def defaultExists(path: Path): Boolean = {
if Files.isDirectory(path) then {
if Files.isDirectory(rootFilePath / path) then {
// If the path is a folder, see if a default file exists...
FileContextHandler.defaultFiles.foldLeft(false) { (b, d) =>
val file = new File((rootFilePath / path / d).toString)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class FileContextHandlerSpec extends FileFixtureSuite {
assert(!ctxHandler.defaultExists(parent / fileName))
}

fileWithSuffix(".txt").test("FileContextHandler.defaultExists .txt") { file =>
fileWithSuffix(".txt").test("FileContextHandler.defaultFile .txt") { file =>
val parent = file.getParent
val fileName = file.relativeTo(parent).toString.stripSuffix(".txt")
val ctxHandler = FileContextHandler(parent)
Expand Down

0 comments on commit 01e1d94

Please sign in to comment.