Fix set-rn-version (#37854)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37854

Changelog: [Internal] - Fix `saveFiles` in set-rn-version, incorrect function invoke

Reviewed By: NickGerleman

Differential Revision: D46582168

fbshipit-source-id: 944e182a88a1aa79bbf47d36ef8395c21dfefb24
This commit is contained in:
Luna Wei
2023-06-14 07:44:51 -07:00
committed by Facebook GitHub Bot
parent af99a6890b
commit 31eb235a6a
2 changed files with 7 additions and 3 deletions
-1
View File
@@ -156,7 +156,6 @@ describe('set-rn-version', () => {
sedMock.mockReturnValueOnce({code: 0});
const filesToValidate = [
'packages/react-native/package.json',
'packages/react-native/ReactAndroid/gradle.properties',
'packages/react-native/template/package.json',
];
+7 -2
View File
@@ -155,14 +155,19 @@ function setReactNativeVersion(argVersion, dependencyVersions, buildType) {
// Create tmp folder for copies of files to verify files have changed
const filesToValidate = [
'packages/react-native/package.json',
'packages/react-native/ReactAndroid/gradle.properties',
'packages/react-native/template/package.json',
];
const tmpVersioningFolder = fs.mkdtempSync(
path.join(os.tmpdir(), 'rn-set-version'),
);
echo(`The tmp versioning folder is ${tmpVersioningFolder}`);
saveFiles(tmpVersioningFolder);
saveFiles(
[
'packages/react-native/package.json',
'packages/react-native/template/package.json',
],
tmpVersioningFolder,
);
setSource(version);
setPackage(version, dependencyVersions);