Commit aed506de by zhangleyuan

f

parent 5a844129
......@@ -3,7 +3,7 @@
* @Author: 吴文洁
* @Date: 2020-06-05 09:38:03
* @LastEditors: 吴文洁
* @LastEditTime: 2020-09-02 15:45:50
* @LastEditTime: 2020-08-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);
}
});
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment