|
1
|
#!/bin/bash |
|
2
|
|
|
3
|
list="" |
|
4
|
app="www/" |
|
5
|
path="../apps/$1" |
|
6
|
alertLevel=$2 |
|
7
|
exceptions=("${@:3}") |
|
8
|
exceptionsCommand="" |
|
9
|
|
|
10
|
for index in ${!exceptions[@]} |
|
11
|
do |
|
12
|
exceptionsCommand+="-not -path $path/${exceptions[$index]} " |
|
13
|
done |
|
14
|
|
|
15
|
if [ ${#alertLevel} -eq 0 ]; then |
|
16
|
alertLevel="suggestion" |
|
17
|
fi |
|
18
|
|
|
19
|
# get directories in content other than reference |
|
20
|
for i in `find $path -type d -maxdepth 1 -not -path $path $exceptionsCommand` |
|
21
|
do |
|
22
|
if [ ${#list} -gt 0 ]; then |
|
23
|
list+=' ' |
|
24
|
fi |
|
25
|
list+="$app${i#../}" |
|
26
|
done |
|
27
|
#get files in content (not nested) |
|
28
|
for i in `find $path -type f -maxdepth 1 $exceptionsCommand` |
|
29
|
do |
|
30
|
if [ ${#list} -gt 0 ]; then |
|
31
|
list+=' ' |
|
32
|
fi |
|
33
|
list+="$app${i#../}" |
|
34
|
done |
|
35
|
|
|
36
|
# echo $list |
|
37
|
cd ../.. |
|
38
|
exec vale $list --minAlertLevel $alertLevel |