Skip to content

Commit 91354fe

Browse files
committed
fix(node): Log the fallback warning only once
Log this only once for the package manager being the fallback, not also for every other Node package manager. Signed-off-by: Sebastian Schuberth <[email protected]>
1 parent da01309 commit 91354fe

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

plugins/package-managers/node/src/main/kotlin/NodePackageManagerDetection.kt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,13 +112,13 @@ internal class NodePackageManagerDetection(private val definitionFiles: Collecti
112112
val projectDir = file.parentFile
113113
val managersFromFiles = projectDirManagers[projectDir].orEmpty()
114114

115-
isApplicable(manager, file) ?: run {
116-
logger.warn {
117-
"Any of $managersFromFiles could be the package manager for '$file'. " +
118-
"Assuming it is a(n) $fallbackType project."
115+
isApplicable(manager, file) ?: (manager == fallbackType).also {
116+
if (it) {
117+
logger.warn {
118+
"Any of $managersFromFiles could be the package manager for '$file'. " +
119+
"Assuming it is a(n) $fallbackType project."
120+
}
119121
}
120-
121-
manager == fallbackType
122122
}
123123
}
124124
}

0 commit comments

Comments
 (0)