2022-03-29 12:35:13 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
2022-04-26 18:27:57 +02:00
|
|
|
if [[ -z "$BASEHREF_VERSION" ]]; then
|
2026-07-17 11:57:32 +02:00
|
|
|
echo "Example of use: \"BASEHREF_VERSION=3.8.0 ${0}\"" 1>&2
|
2022-04-26 18:27:57 +02:00
|
|
|
exit 1
|
|
|
|
|
fi
|
2022-03-29 12:35:13 +02:00
|
|
|
|
2026-07-17 11:57:32 +02:00
|
|
|
# openvidu.io documentation is versioned by MINOR release (folders like "3.8"), so links to
|
|
|
|
|
# it must be pinned to the minor version (X.Y). The full X.Y.Z is left untouched: it is the
|
|
|
|
|
# library version, read from package.json by Compodoc and shown in the generated docs.
|
|
|
|
|
MINOR_VERSION=$(echo "$BASEHREF_VERSION" | grep -oE '^[0-9]+\.[0-9]+')
|
|
|
|
|
if [[ -z "$MINOR_VERSION" ]]; then
|
|
|
|
|
echo "BASEHREF_VERSION must start with X.Y (e.g. \"BASEHREF_VERSION=3.8.0 ${0}\")" 1>&2
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# Replace version from "latest" to the specified minor one in all TypeDoc links
|
|
|
|
|
grep -rl '/latest/' projects src | xargs sed -i -e 's|/latest/|/'${MINOR_VERSION}'/|g'
|
2022-03-29 12:35:13 +02:00
|
|
|
|
2024-07-02 19:19:05 +02:00
|
|
|
# Replace testapp README by openvidu-components-angular README
|
2022-11-21 12:34:14 +01:00
|
|
|
mv README.md README-testapp.md
|
2024-07-02 19:19:05 +02:00
|
|
|
cp ./projects/openvidu-components-angular/README.md .
|
2022-11-21 12:34:14 +01:00
|
|
|
|
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
|
|
|
|
2026-07-17 11:57:32 +02:00
|
|
|
# Return links to "latest" version
|
|
|
|
|
grep -rl '/'${MINOR_VERSION}'/' projects src | xargs sed -i -e 's|/'${MINOR_VERSION}'/|/latest/|g'
|
2022-03-29 12:35:13 +02:00
|
|
|
|
2022-11-21 12:34:14 +01:00
|
|
|
# Undo changes with READMEs
|
|
|
|
|
rm README.md
|
|
|
|
|
mv README-testapp.md README.md
|
|
|
|
|
|
2024-07-26 10:30:24 +02:00
|
|
|
# Clean previous docs from openvidu.io repo and copy new ones
|
2022-04-26 18:27:57 +02:00
|
|
|
npm run doc:clean-copy
|