Skip to content

Commit 78f34dc

Browse files
committed
Add optional commandLinePrefix on windows to run CLI in a shell
1 parent f6be1a2 commit 78f34dc

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/host/android/build.gradle

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import java.nio.file.Paths
22
import groovy.json.JsonSlurper
3+
import org.gradle.internal.os.OperatingSystem
34

45
buildscript {
56
ext.getExtOrDefault = {name ->
@@ -150,13 +151,14 @@ task checkHermesOverride {
150151
}
151152
}
152153

154+
def commandLinePrefix = OperatingSystem.current().isWindows() ? ["cmd", "/c"] : []
153155
def cliPath = file("../bin/react-native-node-api.mjs")
154156

155157
// Custom task to fetch jniLibs paths via CLI
156158
task linkNodeApiModules {
157159
doLast {
158160
exec {
159-
commandLine cliPath, 'link', '--android', rootProject.rootDir.absolutePath
161+
commandLine commandLinePrefix + [cliPath, 'link', '--android', rootProject.rootDir.absolutePath]
160162
standardOutput = System.out
161163
errorOutput = System.err
162164
// Enable color output

0 commit comments

Comments
 (0)