Skip to content

Commit 0e59e27

Browse files
committed
pods: Fix react-native/../react-native resolution failure
1 parent fa2a561 commit 0e59e27

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

packages/react-native-gesture-handler/scripts/gesture_handler_utils.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
def try_to_parse_react_native_package_json(node_modules_dir)
2-
react_native_package_json_path = File.join(node_modules_dir, 'react-native/package.json')
1+
def try_to_parse_react_native_package_json(react_native_dir)
2+
react_native_package_json_path = File.join(react_native_dir, 'package.json')
33

44
if !File.exist?(react_native_package_json_path)
55
return nil
@@ -9,12 +9,12 @@ def try_to_parse_react_native_package_json(node_modules_dir)
99
end
1010

1111
def get_react_native_minor_version()
12-
react_native_node_modules_dir = File.join(File.dirname(`cd "#{Pod::Config.instance.installation_root.to_s}" && node --print "require.resolve('react-native/package.json')"`), '..')
13-
react_native_json = try_to_parse_react_native_package_json(react_native_node_modules_dir)
12+
react_native_dir = File.dirname(`cd "#{Pod::Config.instance.installation_root.to_s}" && node --print "require.resolve('react-native/package.json')"`)
13+
react_native_json = try_to_parse_react_native_package_json(react_native_dir)
1414

1515
if react_native_json == nil
1616
node_modules_dir = ENV["REACT_NATIVE_NODE_MODULES_DIR"]
17-
react_native_json = try_to_parse_react_native_package_json(node_modules_dir)
17+
react_native_json = try_to_parse_react_native_package_json(File.join(node_modules_dir, 'react-native'))
1818
end
1919

2020
if react_native_json == nil

0 commit comments

Comments
 (0)