Browse Source
scripts: update check-commit (#43491)
Co-authored-by: taian.lta <taian.lta@antgroup.com>
pull/43496/head
vagusX
1 year ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
9 additions and
4 deletions
-
scripts/check-commit.ts
|
|
@ -57,12 +57,17 @@ 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.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?'), |
|
|
|
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...')); |
|
|
|
} |
|
|
|