react-native-bspatch 3.1.0 → 3.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/tools/bump_version.js +1 -13
package/package.json
CHANGED
package/tools/bump_version.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
// - package.json ("version")
|
|
7
7
|
// - android/app/build.gradle (versionName & increments versionCode)
|
|
8
8
|
// - ios/*.xcodeproj/project.pbxproj (MARKETING_VERSION & increments CURRENT_PROJECT_VERSION)
|
|
9
|
-
//
|
|
9
|
+
// JS reads the native version at runtime (getAppVersion); never hardcode it in source.
|
|
10
10
|
//
|
|
11
11
|
// Usage:
|
|
12
12
|
// node bump_version.js <new_version> [--root <path>]
|
|
@@ -118,16 +118,4 @@ if (fs.existsSync(iosDir)) {
|
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
120
|
|
|
121
|
-
// 4. src/ota/otaConfig.ts (if exists)
|
|
122
|
-
const otaConfigPath = path.join(rootDir, 'src/ota/otaConfig.ts');
|
|
123
|
-
if (fs.existsSync(otaConfigPath)) {
|
|
124
|
-
try {
|
|
125
|
-
let content = fs.readFileSync(otaConfigPath, 'utf8');
|
|
126
|
-
content = content.replace(/export const APP_VERSION = ['"][^'"]+['"];/, `export const APP_VERSION = '${newVersion}';`);
|
|
127
|
-
fs.writeFileSync(otaConfigPath, content, 'utf8');
|
|
128
|
-
console.log(` ✓ src/ota/otaConfig.ts: APP_VERSION → '${newVersion}'`);
|
|
129
|
-
changedCount++;
|
|
130
|
-
} catch (e) {}
|
|
131
|
-
}
|
|
132
|
-
|
|
133
121
|
console.log(`\n✓ Done! Updated ${changedCount} file(s) to version ${newVersion}.\n`);
|