[BUG FIX] Fix path resolution for executables#328
[BUG FIX] Fix path resolution for executables#328rasharab wants to merge 2 commits intonode-gradle:mainfrom
Conversation
deepy
left a comment
There was a problem hiding this comment.
I've got a hunch of what you're trying to solve, but if you can describe the problem I can give better pointers
| * @return The best matching executable path as a String. | ||
| */ | ||
| fun findBestExecutableMatch(executableName: String): String { | ||
| val pathVariable = System.getenv("PATH") ?: return executableName |
There was a problem hiding this comment.
iirc this won't work on windows where environment variables are case-insensitive (and default to Path)
| */ | ||
| class ExecRunner { | ||
| fun execute(projectHelper: ProjectApiHelper, extension: NodeExtension, execConfiguration: ExecConfiguration): ExecResult { | ||
| val executablePath = findBestExecutableMatch(execConfiguration.executable) |
There was a problem hiding this comment.
From a quick glance it looks like this will break the download functionality entirely by only using already installed applications
There was a problem hiding this comment.
We will address these points. Thanks.
There was a problem hiding this comment.
Done with tests to validate behaviour (w/ download and without download)
1. Add abiility for tests to override environment behaviour 2. Fix tests.
77c49cd to
eb959c7
Compare
Updated comments. I prematurely submitted this pr, apologies. |
|
Is this published yet? I have a similar issue when running under WSL2: I have nodejs installed both on windows and on WSL (Ubuntu). Despite having my |
|
I have this issue too. I'm using 7.1.0 and have Node.JS on my Mac (arm64), I'm sure that |
|
I hope this can be merged and published, or at least provide a snapshot publication. |
|
I built it on jitpack.io buildscript {
repositories {
maven(url = "https://jitpack.io")
}
dependencies {
classpath("com.github.NextChapterSoftware.gradle-node-plugin:com.github.node-gradle.node.gradle.plugin:FixGradleNode-SNAPSHOT")
}
}
apply(plugin = "com.github.node-gradle.node")It actually works to me. |
There’s an issue with mac silicion+intellij, whereby gradle process executor is not respecting path environment variables.
This gets around that by using a fix for the plugin whereby we attempt to resolve the path manually.
#152
https://youtrack.jetbrains.com/issue/IDEA-334183
We hit this constantly with our development team and this fix resolved it for us.