Skip to content

Commit 5b1a05b

Browse files
authored
fix(intellij): enable loading nx packages from .nx/installation (#2132)
1 parent 21a2f8b commit 5b1a05b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

apps/intellij/src/main/kotlin/dev/nx/console/utils/NxExecutable.kt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,13 @@ class NxExecutable {
6161
}
6262

6363
fun getNxPackagePath(project: Project, basePath: String): String {
64+
val nxExecutableName =
65+
if (SystemInfo.isWindows && !WslPath.isWslUncPath(basePath)) "nx.bat" else "nx"
66+
val nxExecutable = File(Paths.get(basePath, nxExecutableName).toString())
67+
if (nxExecutable.exists()) {
68+
return Paths.get(basePath, ".nx", "installation", "node_modules", "nx").toString()
69+
}
70+
6471
val yarnPnpManager = YarnPnpManager.getInstance(project)
6572
val virtualBaseFile = VirtualFileManager.getInstance().findFileByNioPath(Paths.get(basePath))
6673
if (virtualBaseFile != null && yarnPnpManager.isUnderPnp(virtualBaseFile)) {

0 commit comments

Comments
 (0)