mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-27 20:49:53 +08:00
chore: sync script with next
This commit is contained in:
parent
14884fe585
commit
6d9cf9e132
@ -15,18 +15,27 @@ function exitProcess(code = 1) {
|
||||
}
|
||||
|
||||
async function checkVersion() {
|
||||
const { versions } = await fetch('http://registry.npmjs.org/antd').then(res => res.json());
|
||||
if (version in versions) {
|
||||
console.log(chalk.yellow('😈 Current version already exists. Forget update package.json?'));
|
||||
console.log(chalk.cyan(' => Current:'), version);
|
||||
exitProcess();
|
||||
try {
|
||||
const { versions } = await fetch('http://registry.npmjs.org/antd').then((res) => res.json());
|
||||
if (version in versions) {
|
||||
console.log(chalk.yellow('😈 Current version already exists. Forget update package.json?'));
|
||||
console.log(chalk.cyan(' => Current:'), version);
|
||||
exitProcess();
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(chalk.red('🚨 Check version failed. Skip...'));
|
||||
}
|
||||
}
|
||||
|
||||
async function checkBranch({ current }) {
|
||||
if (version.includes('-alpha.')) {
|
||||
if (
|
||||
version.includes('-alpha.') ||
|
||||
version.includes('-beta.') ||
|
||||
version.includes('-rc.') ||
|
||||
version.includes('-experimental.')
|
||||
) {
|
||||
console.log(chalk.cyan('😃 Alpha version. Skip branch check.'));
|
||||
} else if (current !== 'master' && current !== '4.0-prepare') {
|
||||
} else if (current !== 'master' && current !== '4.0-prepare' && current !== '4.x-stable') {
|
||||
console.log(chalk.yellow('🤔 You are not in the master branch!'));
|
||||
exitProcess();
|
||||
}
|
||||
@ -43,12 +52,16 @@ async function checkCommit({ files }) {
|
||||
}
|
||||
|
||||
async function checkRemote() {
|
||||
const { remote } = await git.fetch('origin', 'master');
|
||||
if (remote?.indexOf('ant-design/ant-design') === -1) {
|
||||
console.log(
|
||||
chalk.yellow('😓 Your remote origin is not ant-design/ant-design, did you fork it?'),
|
||||
);
|
||||
exitProcess();
|
||||
try {
|
||||
const { remote } = await git.fetch('origin', 'master');
|
||||
if (remote?.indexOf('ant-design/ant-design') === -1) {
|
||||
console.log(
|
||||
chalk.yellow('😓 Your remote origin is not ant-design/ant-design, did you fork it?'),
|
||||
);
|
||||
exitProcess();
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(chalk.red('🚨 Check remote failed. Skip...'));
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user