Skip to content

Commit 325be42

Browse files
Dmitry Rykunfacebook-github-bot
authored andcommitted
Relative path support for app_path added
Summary: Changelog: [Internal] This diff add support of relative paths in `app_path` argument of `use_react_native` function. Ruby's `relative_path_from` function requires both paths to be either relative or absolute. I added `realpath()` call that converts any path to absolute. Reviewed By: ShikaSD Differential Revision: D33311728 fbshipit-source-id: 393a7b4f0eb26831f4d9f4cec8ec180b41cad580
1 parent b347c39 commit 325be42

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

scripts/react_native_pods.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ def get_react_codegen_script_phases(options={})
416416
end
417417

418418
# We need to convert paths to relative path from installation_root for the script phase for CI.
419-
relative_app_root = Pathname.new(app_path).relative_path_from(Pod::Config.instance.installation_root)
419+
relative_app_root = Pathname.new(app_path).realpath().relative_path_from(Pod::Config.instance.installation_root)
420420

421421
config_file_dir = options[:config_file_dir] ||= ''
422422
relative_config_file_dir = ''
@@ -440,7 +440,7 @@ def get_react_codegen_script_phases(options={})
440440
library_dir = File.join(app_path, library['jsSrcsDir'])
441441
file_list.concat (`find #{library_dir} -type f \\( -name "Native*.js" -or -name "*NativeComponent.js" \\)`.split("\n").sort)
442442
end
443-
input_files = file_list.map { |filename| "${PODS_ROOT}/../#{Pathname.new(filename).relative_path_from(Pod::Config.instance.installation_root)}" }
443+
input_files = file_list.map { |filename| "${PODS_ROOT}/../#{Pathname.new(filename).realpath().relative_path_from(Pod::Config.instance.installation_root)}" }
444444

445445
# Add a script phase to trigger generate artifact.
446446
# Some code is duplicated so that it's easier to delete the old way and switch over to this once it's stabilized.

0 commit comments

Comments
 (0)