[Gradle, JS] Windows environment for not ignoring scripts
This commit is contained in:
+7
-2
@@ -56,8 +56,13 @@ interface NpmApi : Serializable {
|
|||||||
|
|
||||||
data class NpmEnvironment(
|
data class NpmEnvironment(
|
||||||
val rootPackageDir: File,
|
val rootPackageDir: File,
|
||||||
val nodeExecutable: String
|
val nodeExecutable: String,
|
||||||
|
val isWindows: Boolean
|
||||||
) : Serializable
|
) : Serializable
|
||||||
|
|
||||||
internal val NodeJsRootExtension.asNpmEnvironment
|
internal val NodeJsRootExtension.asNpmEnvironment
|
||||||
get() = NpmEnvironment(rootPackageDir, requireConfigured().nodeExecutable)
|
get() = NpmEnvironment(
|
||||||
|
rootPackageDir,
|
||||||
|
requireConfigured().nodeExecutable,
|
||||||
|
requireConfigured().isWindows
|
||||||
|
)
|
||||||
|
|||||||
+11
-4
@@ -44,10 +44,17 @@ abstract class YarnBasics : NpmApi {
|
|||||||
).filter { it.isNotEmpty() }
|
).filter { it.isNotEmpty() }
|
||||||
|
|
||||||
val nodeExecutable = nodeJs.nodeExecutable
|
val nodeExecutable = nodeJs.nodeExecutable
|
||||||
exec.environment(
|
if (!yarn.ignoreScripts) {
|
||||||
"PATH",
|
val nodePath = if (nodeJs.isWindows) {
|
||||||
"$nodeExecutable${File.pathSeparator}${System.getenv("PATH")}"
|
File(nodeExecutable).parent
|
||||||
)
|
} else {
|
||||||
|
nodeExecutable
|
||||||
|
}
|
||||||
|
exec.environment(
|
||||||
|
"PATH",
|
||||||
|
"$nodePath${File.pathSeparator}${System.getenv("PATH")}"
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
val command = yarn.executable
|
val command = yarn.executable
|
||||||
if (yarn.standalone) {
|
if (yarn.standalone) {
|
||||||
|
|||||||
Reference in New Issue
Block a user