api-docs: return error if bundle HTML is not appended to .tmp files. (#2585)
parent
d1ac50d747
commit
f2dfb41a58
|
@ -66,9 +66,28 @@ weight: 304
|
|||
# Create temp file with frontmatter and Redoc html
|
||||
echo "$v2frontmatter" >> $version.tmp
|
||||
echo "$v1frontmatter" >> $version-v1-compat.tmp
|
||||
|
||||
V2LEN_INIT=$(wc -c $version.tmp | awk '{print $1}')
|
||||
V1LEN_INIT=$(wc -c $version-v1-compat.tmp | awk '{print $1}')
|
||||
|
||||
cat redoc-static.html >> $version.tmp
|
||||
cat redoc-static-v1-compat.html >> $version-v1-compat.tmp
|
||||
|
||||
V2LEN=$(wc -c $version.tmp | awk '{print $1}')
|
||||
V1LEN=$(wc -c $version-v1-compat.tmp | awk '{print $1}')
|
||||
|
||||
if ! [[ $V2LEN -gt $V2LEN_INIT ]]
|
||||
then
|
||||
echo "Error: bundle was not appended to $version.tmp"
|
||||
exit $?
|
||||
fi
|
||||
|
||||
if ! [[ $V1LEN -gt $V1LEN_INIT ]]
|
||||
then
|
||||
echo "Error: bundle was not appended to $version-v1-compat.tmp"
|
||||
exit $?
|
||||
fi
|
||||
|
||||
# Remove redoc file and move the tmp file to it's proper place
|
||||
rm -f redoc-static.html
|
||||
rm -f redoc-static-v1-compat.html
|
||||
|
|
Loading…
Reference in New Issue