Skip to content

Commit

Permalink
scripts: update check-commit (ant-design#43491)
Browse files Browse the repository at this point in the history
Co-authored-by: taian.lta <[email protected]>
  • Loading branch information
vagusX and taian.lta authored Jul 11, 2023
1 parent bac7ee3 commit 4f416c6
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions scripts/check-commit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,16 @@ async function checkCommit({ files }: StatusResult) {
async function checkRemote() {
try {
const { remote } = await git.fetch('origin', 'master');
console.log(chalk.blue('⛳ Checking origin master with `git fetch origin master`'));
if (!remote?.includes('ant-design/ant-design')) {
console.log(
chalk.yellow('😓 Your remote origin is not ant-design/ant-design, did you fork it?'),
);
exitProcess();
console.log(chalk.blue('⛳ Checking locally with `git config --get remote.origin.url`'));
const { value } = await git.getConfig('remote.origin.url');
if (!value?.includes('ant-design/ant-design')) {
console.log(
chalk.yellow('🧐 Your remote origin is not ant-design/ant-design, did you fork it?'),
);
exitProcess();
}
}
} catch {
console.log(chalk.red('🚨 Check remote failed. Skip...'));
Expand Down

0 comments on commit 4f416c6

Please sign in to comment.