[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(
|
||||
val rootPackageDir: File,
|
||||
val nodeExecutable: String
|
||||
val nodeExecutable: String,
|
||||
val isWindows: Boolean
|
||||
) : Serializable
|
||||
|
||||
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() }
|
||||
|
||||
val nodeExecutable = nodeJs.nodeExecutable
|
||||
exec.environment(
|
||||
"PATH",
|
||||
"$nodeExecutable${File.pathSeparator}${System.getenv("PATH")}"
|
||||
)
|
||||
if (!yarn.ignoreScripts) {
|
||||
val nodePath = if (nodeJs.isWindows) {
|
||||
File(nodeExecutable).parent
|
||||
} else {
|
||||
nodeExecutable
|
||||
}
|
||||
exec.environment(
|
||||
"PATH",
|
||||
"$nodePath${File.pathSeparator}${System.getenv("PATH")}"
|
||||
)
|
||||
}
|
||||
|
||||
val command = yarn.executable
|
||||
if (yarn.standalone) {
|
||||
|
||||
Reference in New Issue
Block a user