Skip to content

Commit 023360b

Browse files
authored
fix: don't use yarn for spawning 'config' command (#449)
1 parent de936f6 commit 023360b

File tree

2 files changed

+2
-18
lines changed

2 files changed

+2
-18
lines changed

packages/platform-android/native_modules.gradle

+2-10
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,6 @@ class ReactNativeModules {
5555
private ArrayList<HashMap<String, String>> reactNativeModules
5656

5757
private static String LOG_PREFIX = ":ReactNative:"
58-
private static String REACT_NATIVE_CONFIG_CMD = "yarn run --silent react-native config"
59-
private static String REACT_NATIVE_CONFIG_CMD_FALLBACK = "node ./node_modules/.bin/react-native config"
6058

6159
ReactNativeModules(Logger logger) {
6260
this.logger = logger
@@ -175,20 +173,14 @@ class ReactNativeModules {
175173

176174
def cmdProcess
177175
def root = getReactNativeProjectRoot()
178-
def command = REACT_NATIVE_CONFIG_CMD_FALLBACK
176+
def command = "node ./node_modules/.bin/react-native config"
179177

180178
try {
181-
try {
182-
// Check if project uses Yarn
183-
def isYarnProject = Runtime.getRuntime().exec("node -e console.log(require.resolve('./yarn.lock'))", null, root)
184-
isYarnProject.waitFor()
185-
command = REACT_NATIVE_CONFIG_CMD
186-
} catch(Exception exception) {}
187179
cmdProcess = Runtime.getRuntime().exec(command, null, root)
188180
cmdProcess.waitFor()
189181
} catch (Exception exception) {
190182
this.logger.warn("${LOG_PREFIX}${exception.message}")
191-
this.logger.warn("${LOG_PREFIX}Automatic import of native modules failed. (UNKNOWN)")
183+
this.logger.warn("${LOG_PREFIX}Automatic import of native modules failed.")
192184
return reactNativeModules
193185
}
194186

packages/platform-ios/native_modules.rb

-8
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,6 @@ def use_native_modules!(root = "..", packages = nil)
77
if (!packages)
88
command = "node"
99
args = ["./node_modules/.bin/react-native", "config"]
10-
begin
11-
# Check if project uses Yarn
12-
Pod::Executable.execute_command("node", ["-e", "console.log(require.resolve('#{root}/yarn.lock'))"], true)
13-
command = "yarn"
14-
args = ["run", "--silent", "react-native", "config"]
15-
rescue
16-
end
17-
1810
output = ""
1911
# Make sure `react-native config` is ran from your project root
2012
Dir.chdir(root) do

0 commit comments

Comments
 (0)