Skip to content

Commit

Permalink
LicenseFilenamePatterns: Improve getFileGlobsForDirectoryAndAncestors()
Browse files Browse the repository at this point in the history
To use a more generic input for easier re-use.

Signed-off-by: Frank Viernau <[email protected]>
  • Loading branch information
fviernau committed Oct 5, 2020
1 parent ce590f5 commit 8e57183
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion utils/src/main/kotlin/LicenseFilenamePatterns.kt
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,10 @@ object LicenseFilenamePatterns {
* Return glob patterns which match files in [directory], in any ancestor directory of [directory] recursively
* and in any sub-directory of directory, if the filename matches any of the [filenamePatterns].
*/
internal fun getFileGlobsForDirectoryAndAncestors(directory: String, filenamePatterns: List<String>): List<String> {
internal fun getFileGlobsForDirectoryAndAncestors(
directory: String,
filenamePatterns: Collection<String>
): List<String> {
val patternsForDir = filenamePatterns.map {
getFileGlobForDirectory(File(directory).invariantSeparatorsPath, it, true)
}
Expand Down

0 comments on commit 8e57183

Please sign in to comment.