From a8786f2ca82ff059494f809e48f45bf737ab9d29 Mon Sep 17 00:00:00 2001 From: Phil Pluckthun Date: Sat, 30 Aug 2025 15:08:42 +0100 Subject: [PATCH] Replace execSync with paths that need escaping --- packages/react-native/scripts/replace-rncore-version.js | 6 ++++-- .../sdks/hermes-engine/utils/replace_hermes_version.js | 6 ++++-- .../third-party-podspecs/replace_dependencies_version.js | 6 ++++-- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/packages/react-native/scripts/replace-rncore-version.js b/packages/react-native/scripts/replace-rncore-version.js index 16c2d7621505ef..1385b71ffb4acb 100644 --- a/packages/react-native/scripts/replace-rncore-version.js +++ b/packages/react-native/scripts/replace-rncore-version.js @@ -10,7 +10,7 @@ 'use strict'; -const {execSync} = require('child_process'); +const {spawnSync} = require('child_process'); const fs = require('fs'); const yargs = require('yargs'); @@ -67,7 +67,9 @@ function replaceRNCoreConfiguration( fs.mkdirSync(finalLocation, {recursive: true}); console.log('Extracting the tarball', tarballURLPath); - execSync(`tar -xf ${tarballURLPath} -C ${finalLocation}`); + spawnSync('tar', ['-xf', tarballURLPath, '-C', finalLocation], { + stdio: 'inherit', + }); } function updateLastBuildConfiguration(configuration /*: string */) { diff --git a/packages/react-native/sdks/hermes-engine/utils/replace_hermes_version.js b/packages/react-native/sdks/hermes-engine/utils/replace_hermes_version.js index 3dc996471318f7..18ef3877b563a3 100644 --- a/packages/react-native/sdks/hermes-engine/utils/replace_hermes_version.js +++ b/packages/react-native/sdks/hermes-engine/utils/replace_hermes_version.js @@ -10,7 +10,7 @@ 'use strict'; -const {execSync} = require('child_process'); +const {spawnSync} = require('child_process'); const fs = require('fs'); const yargs = require('yargs'); @@ -62,7 +62,9 @@ function replaceHermesConfiguration(configuration, version, podsRoot) { fs.mkdirSync(finalLocation, {recursive: true}); console.log('Extracting the tarball'); - execSync(`tar -xf ${tarballURLPath} -C ${finalLocation}`); + spawnSync('tar', ['-xf', tarballURLPath, '-C', finalLocation], { + stdio: 'inherit', + }); } function updateLastBuildConfiguration(configuration) { diff --git a/packages/react-native/third-party-podspecs/replace_dependencies_version.js b/packages/react-native/third-party-podspecs/replace_dependencies_version.js index 56d0b9f2706b42..66fa888758ebb5 100644 --- a/packages/react-native/third-party-podspecs/replace_dependencies_version.js +++ b/packages/react-native/third-party-podspecs/replace_dependencies_version.js @@ -10,7 +10,7 @@ 'use strict'; -const {execSync} = require('child_process'); +const {spawnSync} = require('child_process'); const fs = require('fs'); const yargs = require('yargs'); @@ -66,7 +66,9 @@ function replaceRNDepsConfiguration( fs.mkdirSync(finalLocation, {recursive: true}); console.log('Extracting the tarball', tarballURLPath); - execSync(`tar -xf ${tarballURLPath} -C ${finalLocation}`); + spawnSync('tar', ['-xf', tarballURLPath, '-C', finalLocation], { + stdio: 'inherit', + }); // Now we need to remove the extra third-party folder as we do in the podspec's prepare-script // We need to take the ReactNativeDependencies.xcframework folder and move it up one level