forked from Expensify/App
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path@react-native-community+cli-platform-ios+12.3.2.patch
46 lines (40 loc) · 1.67 KB
/
@react-native-community+cli-platform-ios+12.3.2.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
diff --git a/node_modules/@react-native-community/cli-platform-ios/native_modules.rb b/node_modules/@react-native-community/cli-platform-ios/native_modules.rb
index 82f537c..df441e2 100644
--- a/node_modules/@react-native-community/cli-platform-ios/native_modules.rb
+++ b/node_modules/@react-native-community/cli-platform-ios/native_modules.rb
@@ -12,7 +12,7 @@
require 'pathname'
require 'cocoapods'
-def use_native_modules!(config = nil)
+def updateConfig(config = nil)
if (config.is_a? String)
Pod::UI.warn("Passing custom root to use_native_modules! is deprecated.",
[
@@ -24,7 +24,6 @@ def use_native_modules!(config = nil)
# Resolving the path the RN CLI. The `@react-native-community/cli` module may not be there for certain package managers, so we fall back to resolving it through `react-native` package, that's always present in RN projects
cli_resolve_script = "try {console.log(require('@react-native-community/cli').bin);} catch (e) {console.log(require('react-native/cli').bin);}"
cli_bin = Pod::Executable.execute_command("node", ["-e", cli_resolve_script], true).strip
-
if (!config)
json = []
@@ -36,9 +35,24 @@ def use_native_modules!(config = nil)
config = JSON.parse(json.join("\n"))
end
+end
+
+def use_native_modules!(config = nil)
+ if (ENV['REACT_NATIVE_DIR'])
+ Dir.chdir(ENV['REACT_NATIVE_DIR']) do
+ config = updateConfig(config)
+ end
+ else
+ config = updateConfig(config)
+ end
project_root = Pathname.new(config["project"]["ios"]["sourceDir"])
+ if(ENV["PROJECT_ROOT_DIR"])
+ project_root = File.join(Dir.pwd, ENV["PROJECT_ROOT_DIR"])
+
+ end
+
packages = config["dependencies"]
found_pods = []