Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(ios): remove deprecated param in use_native_modules #2185

Merged
merged 1 commit into from
Nov 28, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 7 additions & 17 deletions packages/cli-platform-ios/native_modules.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,31 +12,21 @@
require 'pathname'
require 'cocoapods'

def use_native_modules!(config = nil)
if (config.is_a? String)
Pod::UI.warn("Passing custom root to use_native_modules! is deprecated.",
[
"CLI detects root of the project automatically. The \"#{config}\" argument was ignored.",
]);
config = nil;
end

def use_native_modules!()
# 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 = []
json = []

IO.popen(["node", cli_bin, "config"]) do |data|
while line = data.gets
json << line
end
IO.popen(["node", cli_bin, "config"]) do |data|
while line = data.gets
json << line
end

config = JSON.parse(json.join("\n"))
end

config = JSON.parse(json.join("\n"))

project_root = Pathname.new(config["project"]["ios"]["sourceDir"])

packages = config["dependencies"]
Expand Down
Loading