mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-02 12:09:14 +08:00
scripts: update check-commit (#43491)
Co-authored-by: taian.lta <taian.lta@antgroup.com>
This commit is contained in:
parent
bac7ee3fdb
commit
4f416c64b1
@ -57,12 +57,17 @@ async function checkCommit({ files }: StatusResult) {
|
|||||||
async function checkRemote() {
|
async function checkRemote() {
|
||||||
try {
|
try {
|
||||||
const { remote } = await git.fetch('origin', 'master');
|
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')) {
|
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(
|
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();
|
exitProcess();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} catch {
|
} catch {
|
||||||
console.log(chalk.red('🚨 Check remote failed. Skip...'));
|
console.log(chalk.red('🚨 Check remote failed. Skip...'));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user