diff --git a/scripts/check-commit.js b/scripts/check-commit.js index c34e2d57f4..59eeb4343b 100755 --- a/scripts/check-commit.js +++ b/scripts/check-commit.js @@ -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...')); } }