1/** 2 * Copyright (c) Meta Platforms, Inc. and affiliates. 3 * 4 * This source code is licensed under the MIT license found in the 5 * LICENSE file in the root directory of this source tree. 6 * 7 * @format 8 */ 9 10'use strict'; 11 12const fs = require('fs'); 13const path = require('path'); 14 15const version = process.argv[2]; 16 17if (!version) { 18 console.error('Please provide a react-native version.'); 19 process.exit(1); 20} 21 22const jsonPath = path.join(__dirname, '../template/package.json'); 23 24let templatePackageJson = require(jsonPath); 25templatePackageJson.dependencies['react-native'] = version; 26fs.writeFileSync( 27 jsonPath, 28 JSON.stringify(templatePackageJson, null, 2) + '\n', 29 'utf-8', 30); 31