chore: adjust script with check remote

This commit is contained in:
二货机器人 2022-11-14 11:44:34 +08:00
parent f3386666c7
commit 5910f97b8b

View File

@ -52,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...'));
}
}