Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
gitlab-ci-template
Project
Project
Details
Activity
Releases
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PublicSource
gitlab-ci-template
Commits
bbb4467d
Commit
bbb4467d
authored
Nov 11, 2021
by
吴军
⛏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化检测脚本
parent
e9231494
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
check-vue.sh
check-vue.sh
+6
-5
No files found.
check-vue.sh
View file @
bbb4467d
...
@@ -40,9 +40,9 @@ function push_check_status() {
...
@@ -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}'
`
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
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
}
"
echo
-e
"
\n
${
PURPLE
}
================== 开始检测JS文件==================
${
COLOR_END
}
"
for
file
in
$count
;
do
#
for file in $count; do
# 文件状态
# 文件状态
# D: deleted
# D: deleted
# A: added
# A: added
...
@@ -52,14 +52,15 @@ if [[ -n "$count" ]]; then
...
@@ -52,14 +52,15 @@ if [[ -n "$count" ]]; then
# 文件名
# 文件名
#file=$(echo $line | sed 's/^.//')
#file=$(echo $line | sed 's/^.//')
# echo $file
# echo $file
echo
-e
"
\n
$file
"
# echo -e "\n$file"
vue-cli-service lint
--fix
$file
&>> check_result.txt
echo
-e
"
\n
$count
"
npm run lint
$file
&>> check_result.txt
output
=
$?
output
=
$?
if
[
$output
!=
0
]
;
then
if
[
$output
!=
0
]
;
then
let
"errors_count = errors_count + 1"
let
"errors_count = errors_count + 1"
fi
fi
done
#
done
fi
fi
if
[[
$errors_count
>
0
]]
;
then
if
[[
$errors_count
>
0
]]
;
then
...
...
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