File tree 1 file changed +10
-9
lines changed
src/main/scala/dev/atedeg
1 file changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -19,16 +19,17 @@ final case class Selector(selector: String) {
19
19
.filterOrElse(_.nonEmpty, s " No files found matching selector $selector" )
20
20
}
21
21
22
- private def unsafeToFiles (workingDir : File ): List [File ] = {
23
- val dir = File (workingDir, selector)
24
- if (dir.isDirectory) dir.listHtmlFiles.toList
25
- else {
26
- workingDir.listHtmlFiles.find(_.nameWithoutExtension == selector) match {
27
- case Some (f) => List (f)
28
- case None => workingDir.globHtmlFiles(selector).toList
29
- }
22
+ private def unsafeToFiles (workingDir : File ): List [File ] =
23
+ htmlFilesInDirectory(File (workingDir, selector)) ++ selectorToFileOrGlob(workingDir)
24
+
25
+ private def selectorToFileOrGlob (workingDir : File ): List [File ] =
26
+ workingDir.listHtmlFiles.find(_.nameWithoutExtension == selector) match {
27
+ case Some (f) => List (f)
28
+ case None => workingDir.globHtmlFiles(selector).toList
30
29
}
31
- }
30
+
31
+ private def htmlFilesInDirectory (dir : File ): List [File ] =
32
+ if (dir.isDirectory) dir.listHtmlFiles.toList else List ()
32
33
}
33
34
34
35
final case class Configuration (ignored : List [Selector ], tables : List [TableConfig ])
You can’t perform that action at this time.
0 commit comments