fix: Resolve node_modules/
better (#706)
* fix: Use `rootDir` instead of `projectDir` * Revert "fix: Use `rootDir` instead of `projectDir`" This reverts commit 058e0a110bcf9b688e12a1cccbac2f23a29fa55c. * fix: Find node_modules path where react-native/ lives * fix: Figure out VisionCameraExample project * Revert "fix: Figure out VisionCameraExample project" This reverts commit 7ca455098244dd62280d40586062803d1ccc2c5f.
This commit is contained in:
parent
1c09ded57e
commit
675dec5ab3
@ -7,9 +7,10 @@ static def findNodeModules(baseDir) {
|
|||||||
// Node's module resolution algorithm searches up to the root directory,
|
// Node's module resolution algorithm searches up to the root directory,
|
||||||
// after which the base path will be null
|
// after which the base path will be null
|
||||||
while (basePath) {
|
while (basePath) {
|
||||||
def candidatePath = Paths.get(basePath.toString(), "node_modules")
|
def nodeModulesPath = Paths.get(basePath.toString(), "node_modules")
|
||||||
if (candidatePath.toFile().exists()) {
|
def reactNativePath = Paths.get(nodeModulesPath.toString(), "react-native")
|
||||||
return candidatePath.toString()
|
if (nodeModulesPath.toFile().exists() && reactNativePath.toFile().exists()) {
|
||||||
|
return nodeModulesPath.toString()
|
||||||
}
|
}
|
||||||
basePath = basePath.getParent()
|
basePath = basePath.getParent()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user