Commit bbb4467d authored by 吴军's avatar 吴军

优化检测脚本

parent e9231494
......@@ -40,9 +40,9 @@ function push_check_status() {
count=`git diff --name-status $CI_COMMIT_BEFORE_SHA $CI_COMMIT_SHA | grep -E '.js$|.vue$' | egrep -v '^D' | awk '{print $2}'`
if [[ -n "$count" ]]; then
npm install @vue/babel-preset-app --registry https://hub.zmcms.cn/repository/npm-group/
# npm install @vue/babel-preset-app --registry https://hub.zmcms.cn/repository/npm-group/
echo -e "\n${PURPLE}================== 开始检测JS文件==================${COLOR_END}"
for file in $count; do
# for file in $count; do
# 文件状态
# D: deleted
# A: added
......@@ -52,14 +52,15 @@ if [[ -n "$count" ]]; then
# 文件名
#file=$(echo $line | sed 's/^.//')
# echo $file
echo -e "\n$file"
vue-cli-service lint --fix $file &>> check_result.txt
# echo -e "\n$file"
echo -e "\n$count"
npm run lint $file &>> check_result.txt
output=$?
if [ $output != 0 ]; then
let "errors_count = errors_count + 1"
fi
done
# done
fi
if [[ $errors_count > 0 ]]; then
......
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