Bash script syntax improvements

This commit is contained in:
Roy Lenferink
2019-01-19 13:58:58 +01:00
parent 771baea30e
commit 6df3deb4bc
12 changed files with 128 additions and 128 deletions

View File

@@ -37,12 +37,12 @@ top_level_models=$(grep '&[A-Za-z]*{},' /register.go | sed 's/.*&//;s/{},//')
VERSION="${1#*_}"
for m in ${top_level_models}
do
if grep -xq "=== ${VERSION}.$m" ./definitions.adoc
if grep -xq "=== ${VERSION}.${m}" ./definitions.adoc
then
buf+="* <<${VERSION}.$m>>\n"
buf+="* <<${VERSION}.${m}>>\n"
fi
done
sed -i "1i $buf" ./definitions.adoc
sed -i "1i ${buf}" ./definitions.adoc
# fix the links in .adoc, replace <<x.y>> with link:definitions.html#_x_y[x.y], and lowercase the _x_y part
sed -i -e 's|<<\(.*\)\.\(.*\)>>|link:#_\L\1_\2\E[\1.\2]|g' ./definitions.adoc