-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_check-artwork-xsl-imgsrc-has-png.sh
executable file
·71 lines (53 loc) · 1.71 KB
/
_check-artwork-xsl-imgsrc-has-png.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/bin/bash
source define_colors.sh
libs="wordNet verbNet propbank frameNet syntagNet bNC"
declare -A uses
uses=(
[browser]="wordNet verbNet propbank bNC predicateMatrix"
[browserewn]="wordNet bNC"
[browserwn]="wordNet bNC"
[browservn]="wordNet verbNet propbank bNC"
[browsersn]="wordNet syntagNet bNC"
[browserfn]="frameNet"
)
# extract source references from html files
findsrc(){
local d="$1"
if [ -z "${d}" ]; then
d=.
fi
find ${d} -name '*.xsl' -path '*/src/main/*' -exec grep 'src=' {} \; | sed "s/['\"]/\"/g" | grep -Po 'src="\K[^"]*' | LC_COLLATE=C sort -u
}
findfileswithsrc(){
local d="$1"
if [ -z "${d}" ]; then
d=.
fi
find ${d} -name '*.xsl' -path '*/src/main/*' -exec grep -l 'src=' {} \;
}
for a in ${!uses[@]}; do
echo -e "${Y}app ${a}${Z}"
modules=${uses[${a}]}
for m in ${modules}; do
echo -e "${M}module ${m}${Z}"
echo -e "${C}source files for ${m}${Z}"
while read f; do echo -e "${C}${f}${Z}"; done < <(findfileswithsrc ${m})
echo -e "${B}use image files for ${m}${Z}"
while read f; do echo -e "${B}${f}${Z}"; done < <(findsrc ${m})
dir="${a}/src/main/assets"
echo -e "${G}scan ${dir}${Z}"
while read f; do [ -e "${dir}/${f}" ] || echo -e "${R}${dir}/${f} !EXISTS${Z}"; done < <(findsrc ${m})
done
echo
done
echo
for m in ${libs}; do
echo -e "${Y}module ${m}${Z}"
echo -e "${C}source files for ${m}${Z}"
while read f; do echo -e "${C}${f}${Z}"; done < <(findfileswithsrc ${m})
echo -e "${B}use image files for ${m}${Z}"
while read f; do echo -e "${B}${f}${Z}"; done < <(findsrc ${m})
dir="${m}/src/main/assets"
echo -e "${G}scan ${dir}${Z}"
while read f; do [ -e "${dir}/${f}" ] || echo -e "${R}${dir}/${f} !EXISTS${Z}"; done < <(findsrc ${m})
done