File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
plugins/package-managers/node/src/main/kotlin Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -101,20 +101,24 @@ internal class NodePackageManagerDetection(private val definitionFiles: Collecti
101101 }
102102
103103 /* *
104- * Return those [definitionFiles] that define root projects for the given [manager].
104+ * Return those [definitionFiles] that define root projects for the given [manager], or that are managed by
105+ * [fallbackType] as a fallback.
105106 */
106- fun filterApplicable (manager : NodePackageManagerType ): List <File > =
107+ fun filterApplicable (
108+ manager : NodePackageManagerType ,
109+ fallbackType : NodePackageManagerType = NodePackageManagerType .NPM
110+ ): List <File > =
107111 definitionFiles.filter { file ->
108112 val projectDir = file.parentFile
109113 val managersFromFiles = projectDirManagers[projectDir].orEmpty()
110114
111115 isApplicable(manager, file) ? : run {
112- // Looking at the workspaces did not bring any clarity, so assume the package manager is NPM.
113116 logger.warn {
114- " Any of $managersFromFiles could be the package manager for '$file '. Assuming it is an NPM project."
117+ " Any of $managersFromFiles could be the package manager for '$file '. " +
118+ " Assuming it is a(n) $fallbackType project."
115119 }
116120
117- manager == NodePackageManagerType . NPM
121+ manager == fallbackType
118122 }
119123 }
120124}
You can’t perform that action at this time.
0 commit comments