Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xiaomai-cloud-class-web
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
xiaomai-cloud-class-web
Commits
aed506de
Commit
aed506de
authored
Jun 04, 2021
by
zhangleyuan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
f
parent
5a844129
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
6 deletions
+4
-6
hooks/pre-commit.js
+4
-5
src/modules/home/Home.jsx
+0
-1
No files found.
hooks/pre-commit.js
View file @
aed506de
...
...
@@ -3,7 +3,7 @@
* @Author: 吴文洁
* @Date: 2020-06-05 09:38:03
* @LastEditors: 吴文洁
* @LastEditTime: 2020-0
9-02 15:45:50
* @LastEditTime: 2020-0
8-12 10:00:56
* @Description:
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
...
...
@@ -26,8 +26,8 @@ if (!firstMatch && !secondMatch) {
// 获取缓存区内容
// 通过diff指令获得所有改动过(不包括删除)的js文件路径
const
fileNameStr
=
execSync
(
'git diff
--diff-filter=AM
--cached HEAD --name-only'
).
toString
();
const
fileNameList
=
fileNameStr
.
split
(
'
\
n'
)
.
filter
(
item
=>
!!
item
)
;
const
fileNameStr
=
execSync
(
'git diff
-index
--cached HEAD --name-only'
).
toString
();
const
fileNameList
=
fileNameStr
.
split
(
'
\
n'
);
// 获取需要检测的文件
const
detectedFileList
=
fileNameList
.
filter
(
file
=>
{
...
...
@@ -39,8 +39,7 @@ const detectedFileList = fileNameList.filter(file => {
let
errorFileList
=
[];
detectedFileList
.
forEach
((
file
)
=>
{
const
results
=
execSync
(
`git diff --cached
${
file
}
`
);
const
pattern
=
/^http:
\/\/{1,}
/
;
if
(
pattern
.
test
(
results
.
toString
()))
{
if
(
results
.
toString
().
indexOf
(
'http://'
)
>
0
)
{
errorFileList
.
push
(
file
);
}
});
...
...
src/modules/home/Home.jsx
View file @
aed506de
...
...
@@ -23,7 +23,6 @@ import User from '@/common/js/user';
import
'./Home.less'
;
const
Option
=
Select
.
Option
;
class
Home
extends
React
.
Component
{
constructor
(
props
)
{
super
(
props
);
...
...
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