Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
rl.question('Next version will be `' + nextVersion + '`, okay? y/n ', yn => {
if (yn !== 'y' && yn !== 'Y') {
console.log('Release cancelled.\n');
process.exit(1);
return;
}
const pkgJSON = JSON.parse(fs.readFileSync('./package.json'));
const pkgLockJSON = JSON.parse(fs.readFileSync('./package-lock.json'));
pkgJSON.version = nextVersion;
pkgLockJSON.version = nextVersion;
fs.writeFileSync('./package.json', JSON.stringify(pkgJSON, null, 2));
fs.writeFileSync('./package-lock.json', JSON.stringify(pkgLockJSON, null, 2));
ReactNativeVersion.version(
{
neverAmend: true,
target: 'android',
},
path.resolve(__dirname, '../'),
).catch(err => {
console.error(err);
process.exit(1);
});
rl.close();
});