KT-34468 Yarn. Lock file check at the beginning

This commit is contained in:
Victor Turansky
2020-03-24 00:49:29 +03:00
committed by Ilya Goncharov
parent 8cd23dfc9a
commit 35e3691d6c
@@ -98,8 +98,11 @@ abstract class YarnBasics : NpmApi {
nodeWorkDir: File, nodeWorkDir: File,
srcDependenciesList: Collection<NpmDependency> srcDependenciesList: Collection<NpmDependency>
) { ) {
val yarnLock = nodeWorkDir.resolve("yarn.lock") val yarnLock = nodeWorkDir
if (yarnLock.isFile) { .resolve("yarn.lock")
.takeIf { it.isFile }
?: return
val byKey = YarnLock.parse(yarnLock).entries.associateBy { it.dependencyKey } val byKey = YarnLock.parse(yarnLock).entries.associateBy { it.dependencyKey }
val visited = mutableMapOf<NpmDependency, NpmDependency>() val visited = mutableMapOf<NpmDependency, NpmDependency>()
@@ -152,4 +155,3 @@ abstract class YarnBasics : NpmApi {
} }
} }
} }
}