Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wechat-common
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xiaomai-cloud-class
wechat-common
Commits
83078b32
Commit
83078b32
authored
Jul 01, 2021
by
guomingpang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 新增登陆时租户配置遇限时提示动画
parent
77bf5d1b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
15 deletions
+12
-15
hooks/pre-commit.js
+12
-15
No files found.
hooks/pre-commit.js
View file @
83078b32
...
...
@@ -10,22 +10,19 @@
const
execSync
=
require
(
'child_process'
).
execSync
;
// // 获取当前分支名称
// const branchName = execSync('git rev-parse --abbrev-ref HEAD').toString().trim();
// // 校验分支名是否合法
// const firstPattern = new RegExp('dev|rc|gray|master');
// const secondPattern = new RegExp('(feature|hotfix)/[a-z]{4,}/[0-9]{8,}/[a-zA-Z-]{4,}');
// const firstMatch = firstPattern.test(branchName);
// console.log('firstPattern ====>',firstMatch)
// 获取当前分支名称
const
branchName
=
execSync
(
'git rev-parse --abbrev-ref HEAD'
).
toString
().
trim
();
// 校验分支名是否合法
const
firstPattern
=
new
RegExp
(
'dev|rc|gray|master'
);
const
secondPattern
=
new
RegExp
(
'(feature|hotfix)/[a-z]{4,}/[0-9]{8,}/[a-zA-Z-]{4,}'
);
// const secondMatch = secondPattern.test(branchName);
// console.log('firstPattern ====>',secondMatch)
// if (!firstMatch && !secondMatch) {
// // eslint-disable-next-line no-console
// console.error(`\x1b[31m ${branchName}不符合分支规范,具体规范请访问 http://wiki.ixm5.cn/pages/viewpage.action?pageId=2918496 \x1b[31m`);
// process.exit(1);
// }
const
firstMatch
=
firstPattern
.
test
(
branchName
);
const
secondMatch
=
secondPattern
.
test
(
branchName
);
if
(
!
firstMatch
&&
!
secondMatch
)
{
// eslint-disable-next-line no-console
console
.
error
(
`\x1b[31m
${
branchName
}
不符合分支规范,具体规范请访问 http://wiki.ixm5.cn/pages/viewpage.action?pageId=2918496 \x1b[31m`
);
process
.
exit
(
1
);
}
// 获取缓存区内容
// 通过diff指令获得所有改动过(不包括删除)的js文件路径
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment