mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-02 03:59:01 +08:00
chore: adjust script not force require npm version check
This commit is contained in:
parent
d71c7116f4
commit
f3386666c7
@ -15,11 +15,15 @@ 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...'));
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user