forked from IanDarwin/Android-Cookbook-Examples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmklist
executable file
·33 lines (29 loc) · 803 Bytes
/
mklist
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
#!/bin/sh
# Generate the included table for the master README file
README_FILE=README.txt
AUTHOR_FILE=AUTHOR.txt
FNAME_STATUS=STATUS.txt
# All Projects Shalle Have Uppercased-first-letter Names!
for d in [A-Z]*
do
if [ -d $d ]; then
if [ -f $d/${README_FILE} ]; then
FUNCTION=$(sed 1q $d/${README_FILE})
if [ -f $d/${FNAME_STATUS} ]; then
NOTES=$(sed 1q $d/${FNAME_STATUS})
else
NOTES="-"
fi
if [ -f $d/${AUTHOR_FILE} ]; then
AUTHOR=$(sed 1q $d/${AUTHOR_FILE})
else
AUTHOR="Ian Darwin"
fi
echo '|' "link:https://github.com/IanDarwin/Android-Cookbook-Examples/tree/master/$d[$d]" '|' ${AUTHOR} '|' $FUNCTION '|' ${NOTES}
else
echo >&2 "$d has no README file"
fi
fi
done |
grep -v _ | # Strip compat_v7 etc
sort -f -t'[' -k2 # sort on link[Name]