Skip to content

Commit

Permalink
[Gradle, JS] Fix path setting in Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
ilgonmic authored and Space committed Dec 8, 2021
1 parent 06a205f commit 9bffcfa
Showing 1 changed file with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,17 @@ abstract class YarnBasics : NpmApi {
if (yarn.ignoreScripts) "--ignore-scripts" else ""

val nodeExecutable = nodeJs.requireConfigured().nodeExecutable
exec.environment(
"PATH",
"$nodeExecutable${File.pathSeparator}${System.getenv("PATH")}"
)
if (!yarn.ignoreScripts) {
val nodePath = if (nodeJs.requireConfigured().isWindows) {
File(nodeExecutable).parent
} else {
nodeExecutable
}
exec.environment(
"PATH",
"$nodePath${File.pathSeparator}${System.getenv("PATH")}"
)
}

val command = yarn.executable
if (yarn.standalone) {
Expand Down

0 comments on commit 9bffcfa

Please sign in to comment.