openvidu/openvidu-components-angular/generate-docs.sh

28 lines
785 B
Bash
Raw Normal View History

2022-03-29 12:35:13 +02:00
#!/bin/bash
2022-04-26 18:27:57 +02:00
if [[ -z "$BASEHREF_VERSION" ]]; then
echo "Example of use: \"BASEHREF_VERSION=2.12.0 ${0}\"" 1>&2
exit 1
fi
2022-03-29 12:35:13 +02:00
# Replace version from "stable" to the specified one in all TypeDoc links
2022-04-26 18:27:57 +02:00
grep -rl '/en/stable/' projects src | xargs sed -i -e 's|/en/stable/|/en/'${BASEHREF_VERSION}'/|g'
2022-03-29 12:35:13 +02:00
# Replace testapp README by openvidu-angular README
mv README.md README-testapp.md
cp ./projects/openvidu-angular/README.md .
2022-03-29 12:35:13 +02:00
# Generate Compodoc
2022-04-26 18:27:57 +02:00
npm run doc:build
2022-03-29 12:35:13 +02:00
# Return links to "stable" version
2022-04-26 18:27:57 +02:00
grep -rl '/en/'${BASEHREF_VERSION}'/' projects src | xargs sed -i -e 's|/en/'${BASEHREF_VERSION}'/|/en/stable/|g'
2022-03-29 12:35:13 +02:00
# Undo changes with READMEs
rm README.md
mv README-testapp.md README.md
2022-03-29 12:35:13 +02:00
# Clean previous docs from openvidu.io-docs repo and copy new ones
2022-04-26 18:27:57 +02:00
npm run doc:clean-copy
2022-03-29 12:35:13 +02:00