-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathGenerateBaseREADME.sh
More file actions
52 lines (46 loc) · 1.86 KB
/
Copy pathGenerateBaseREADME.sh
File metadata and controls
52 lines (46 loc) · 1.86 KB
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
#!/usr/bin/env sh
emotibitSearchText="<table><tr><th>EmotiBit"
featherSearchText="<table><tr><th>Feather"
echo "***********************************************************************************"
echo "Script to automatically generate the main README.md by reading compatibility tables"
echo "from each specified [CaseName]/README.md"
echo "REQUIRES:"
echo "- [CaseName]/assets/preview.gif"
echo "- [CaseName]/README.md::$emotibitSearchText"
echo "- [CaseName]/README.md::$featherSearchText"
echo "***********************************************************************************"
echo ""
dirs=("SwissArmyCase" "Armadillo" "NinjaCase") # specify ordering of cases to include
outFileName="README.md"
echo "## EmotiBit Cases" > ./$outFileName
echo "" >> ./$outFileName
echo "| EmotiBit Case | Preview | EmotiBit<br>Compatibility | Feather<br>Compatibility |" >> ./$outFileName
echo "| ------------- | ------------ | ------------ | ------------ |" >> ./$outFileName
echo "Specified Directories:"
for i in "${dirs[@]}"
do
# No longer need to ommit dirs because we're specifying order
#myDir=${i::-1}
#if { [ $myDir != "assets" ] && [ $myDir != "EmotiBit_3D_Models" ]; }; then
myDir=$i
echo "$myDir"
emotibitTable=""
featherTable=""
searchLen=${#emotibitSearchText}
while IFS= read -r line; do
test=${line:0:$searchLen}
if [ "$test" = $emotibitSearchText ]; then
emotibitTable=${line::-1}
fi
done < $myDir/README.md
searchLen=${#featherSearchText}
while IFS= read -r line; do
test=${line:0:$searchLen}
if [ "$test" = $featherSearchText ]; then
featherTable=${line::-1}
fi
done < $myDir/README.md
echo "| [$myDir](./$myDir/) |  | $emotibitTable | $featherTable |" >> ./$outFileName
done
echo "## Want to Contribute to the EmotiBit Cases Repository?" >> ./$outFileName
echo "See [CONTRIBUTING.md](./CONTRIBUTING.md)" >> ./$outFileName