Skip to content
Closed
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
2 changes: 1 addition & 1 deletion packages/react-native/React-Core-prebuilt.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Pod::Spec.new do |s|
# If we are passing a local tarball, we don't want to switch between Debug and Release
if !ENV["RCT_TESTONLY_RNCORE_TARBALL_PATH"]
script_phase = {
:name => "[RNDeps] Replace React Native Core for the right configuration, if needed",
:name => "[RNCore] Replace React Native Core for the right configuration, if needed",
:execution_position => :before_compile,
:script => <<-EOS
. "$REACT_NATIVE_PATH/scripts/xcode/with-environment.sh"
Expand Down
15 changes: 12 additions & 3 deletions packages/react-native/scripts/replace-rncore-version.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,18 @@ function replaceRNCoreConfiguration(
const tarballURLPath = `${podsRoot}/ReactNativeCore-artifacts/reactnative-core-${version.toLowerCase()}-${configuration.toLowerCase()}.tar.gz`;

const finalLocation = 'React-Core-prebuilt';
console.log('Preparing the final location', finalLocation);
fs.rmSync(finalLocation, {force: true, recursive: true});
fs.mkdirSync(finalLocation, {recursive: true});

// Delete all directories - not files, since we want to keep the React-VFS.yaml file
const dirs = fs
.readdirSync(finalLocation, {withFileTypes: true})
.filter(dirent => dirent.isDirectory());
for (const dirent of dirs) {
const direntName =
typeof dirent.name === 'string' ? dirent.name : dirent.name.toString();
const dirPath = `${finalLocation}/${direntName}`;
console.log('Removing directory', dirPath);
fs.rmSync(dirPath, {force: true, recursive: true});
}

console.log('Extracting the tarball', tarballURLPath);
spawnSync('tar', ['-xf', tarballURLPath, '-C', finalLocation], {
Expand Down
Loading