Skip to content

Commit

Permalink
Fix license recognition issue
Browse files Browse the repository at this point in the history
  • Loading branch information
johnsonlee committed Jan 19, 2022
1 parent aab57a3 commit b05dda7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main/kotlin/io/johnsonlee/gradle/publish/License.kt
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,11 @@ sealed class License(
private val LICENSES = License::class.sealedSubclasses.mapNotNull(KClass<out License>::objectInstance).filterNot(License::family)

fun of(file: File): License? {
FILENAMES.firstOrNull { it.equals(file.name, true) } ?: return null
FILENAMES.takeIf {
file.isFile
}?.firstOrNull {
it.equals(file.name, true)
} ?: return null

val rt1 = RawText(file)
val differ = HistogramDiff()
Expand Down

0 comments on commit b05dda7

Please sign in to comment.