2022-12-11 04:21:56 +08:00
|
|
|
#!/bin/bash
|
|
|
|
|
2023-02-09 17:53:47 +08:00
|
|
|
set -eu
|
2023-01-13 04:46:18 +08:00
|
|
|
|
2023-02-09 17:53:47 +08:00
|
|
|
git fetch --all
|
|
|
|
current_branch=$(git rev-parse --abbrev-ref HEAD)
|
|
|
|
|
|
|
|
git branch --remotes | grep '/v' | while read -r version; do
|
2022-12-11 04:21:56 +08:00
|
|
|
branch=${version##*/}
|
|
|
|
remote=${version%/*}
|
2023-02-09 17:53:47 +08:00
|
|
|
git fetch "$remote" "$branch":"$branch"
|
2022-12-11 04:21:56 +08:00
|
|
|
done
|
|
|
|
|
2023-02-09 17:53:47 +08:00
|
|
|
git branch | sed --quiet 's/^.*v\(.*\).x-release/\1/p' \
|
2022-12-11 04:21:56 +08:00
|
|
|
| while read -r version; do
|
|
|
|
|
2023-02-09 17:53:47 +08:00
|
|
|
git checkout "v${version}.x-release"
|
2022-12-11 04:21:56 +08:00
|
|
|
if [ -f docusaurus.config.js ]; then
|
|
|
|
echo "Adding documentation for $version"
|
2023-01-13 04:46:18 +08:00
|
|
|
yarn docusaurus docs:version "${version}"
|
2022-12-11 04:21:56 +08:00
|
|
|
fi
|
|
|
|
|
|
|
|
done
|
|
|
|
|
2023-02-09 17:53:47 +08:00
|
|
|
git checkout "$current_branch"
|