mirror of https://github.com/abpframework/abp
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
984 B
37 lines
984 B
// ESM syntax is supported.
|
|
import execa from 'execa';
|
|
import fse from 'fs-extra';
|
|
|
|
const versions = ['major', 'minor', 'patch', 'premajor', 'preminor', 'prepatch', 'prerelease'];
|
|
let nextSemanticVersion = (process.argv[2] || '').toLowerCase();
|
|
|
|
if (versions.indexOf(nextSemanticVersion) < 0) {
|
|
console.log(
|
|
"Please enter the next semantic version like this: 'npm run publish patch'. Available versions:\n " +
|
|
JSON.stringify(versions),
|
|
);
|
|
|
|
process.exit(1);
|
|
}
|
|
|
|
(async () => {
|
|
try {
|
|
await execa('yarn', ['install-new-dependencies'], { stdout: 'inherit' });
|
|
|
|
await fse.rename('../lerna.version.json', '../lerna.json');
|
|
|
|
await execa(
|
|
'yarn',
|
|
['lerna', 'version', nextSemanticVersion, '--yes', '--no-commit-hooks', '--skip-git'],
|
|
{ stdout: 'inherit', cwd: '../' },
|
|
);
|
|
|
|
await fse.rename('../lerna.json', '../lerna.version.json');
|
|
} catch (error) {
|
|
console.error(error.stderr);
|
|
process.exit(1);
|
|
}
|
|
|
|
process.exit(0);
|
|
})();
|