Skip to content
Merged
Show file tree
Hide file tree
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
10 changes: 5 additions & 5 deletions packages/platform-android/native_modules.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ class ReactNativeModules {
* Runs a specified command using Runtime exec() in a specified directory.
* Throws when the command result is empty.
*/
String getCommandOutput(String command) {
String getCommandOutput(String[] command) {
try {
def output = ""
def cmdProcess = Runtime.getRuntime().exec(command)
Expand Down Expand Up @@ -193,12 +193,12 @@ class ReactNativeModules {
* @todo: `fastlane` has been reported to not work too.
*/
def cliResolveScript = "console.log(require('@react-native-community/cli').bin);"
def cliPath = this.getCommandOutput("node -e ${cliResolveScript}")

def reactNativeConfigCommand = "node ${cliPath} config"
String[] nodeCommand = ["node", "-e", cliResolveScript]
def cliPath = this.getCommandOutput(nodeCommand)

String[] reactNativeConfigCommand = ["node", cliPath, "config"]
def reactNativeConfigOutput = this.getCommandOutput(reactNativeConfigCommand)

def json
try {
json = new JsonSlurper().parseText(reactNativeConfigOutput)
Expand Down
4 changes: 2 additions & 2 deletions packages/platform-ios/native_modules.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def use_native_modules!(config = nil)
if (!config)
json = []

IO.popen("#{cli_bin} config") do |data|
IO.popen(["node", cli_bin, "config"]) do |data|
while line = data.gets
json << line
end
Expand Down Expand Up @@ -67,7 +67,7 @@ def use_native_modules!(config = nil)
end

podspec_dir_path = Pathname.new(File.dirname(podspec_path))

relative_path = podspec_dir_path.relative_path_from project_root

pod spec.name, :path => relative_path.to_path
Expand Down