+12
-8
@@ -50,9 +50,8 @@ function checkAndPublishPackage(packageDir) {
|
|||||||
// Set the version in package.json
|
// Set the version in package.json
|
||||||
const packageJsonFile = path.join(packageDir, 'package.json');
|
const packageJsonFile = path.join(packageDir, 'package.json');
|
||||||
packageJson.version = nextVersion;
|
packageJson.version = nextVersion;
|
||||||
if (isDryRun) {
|
console.log(`Set version of ${packageJsonFile} to ${nextVersion}`);
|
||||||
console.log(`Set version of ${packageJsonFile} to ${nextVersion}`);
|
if (!isDryRun) {
|
||||||
} else {
|
|
||||||
fs.writeFileSync(packageJsonFile, JSON.stringify(packageJson, null, 2));
|
fs.writeFileSync(packageJsonFile, JSON.stringify(packageJson, null, 2));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -61,11 +60,16 @@ function checkAndPublishPackage(packageDir) {
|
|||||||
if (!isStableRelease) {
|
if (!isStableRelease) {
|
||||||
args.push('--tag', 'beta');
|
args.push('--tag', 'beta');
|
||||||
}
|
}
|
||||||
if (isDryRun) {
|
console.log(`Spawn: npm ${args.join(' ')}`);
|
||||||
console.log(`Spawn: npm ${args.join(' ')}`);
|
if (!isDryRun) {
|
||||||
} else {
|
const result = cp.spawnSync('npm', args, {
|
||||||
const result = cp.spawn('npm', args, { stdio: 'inherit' });
|
cwd: packageDir,
|
||||||
result.on('exit', code => process.exit(code));
|
stdio: 'inherit'
|
||||||
|
});
|
||||||
|
if (result.status) {
|
||||||
|
console.error(`Spawn exited with code ${result.status}`);
|
||||||
|
process.exit(result.status);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
console.groupEnd();
|
console.groupEnd();
|
||||||
|
|||||||
Reference in New Issue
Block a user