| 262 | } |
| 263 | |
| 264 | function updatePackageVersions(previousVersion, nextVersion) { |
| 265 | PACKAGE_PATHS.forEach(partialPath => { |
| 266 | const path = join(ROOT_PATH, partialPath); |
| 267 | const json = readJsonSync(path); |
| 268 | json.version = nextVersion; |
| 269 | |
| 270 | for (let key in json.dependencies) { |
| 271 | if (key.startsWith('react-devtools')) { |
| 272 | const version = json.dependencies[key]; |
| 273 | |
| 274 | json.dependencies[key] = version.replace(previousVersion, nextVersion); |
| 275 | } |
| 276 | } |
| 277 | |
| 278 | console.log(chalk.dim(' Updating package JSON: ' + partialPath)); |
| 279 | |
| 280 | if (!DRY_RUN) { |
| 281 | writeJsonSync(path, json, {spaces: 2}); |
| 282 | } |
| 283 | }); |
| 284 | } |
| 285 | |
| 286 | main(); |