forked from vitessio/website
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rc_release.sh
executable file
·18 lines (14 loc) · 970 Bytes
/
rc_release.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/bash
next_release=$1
for lang in {en,zh} ; do
cp -r content/${lang}/docs/$((next_release-1)).0 content/${lang}/docs/${next_release}.0
sed -E -r -i.bak 's/weight: [0-9]+/weight: '$((100-next_release))'/' ./content/${lang}/docs/$((next_release)).0/_index.md
sed -i.bak 's/'$((next_release-1))'.0/'$((next_release))'.0/' ./content/${lang}/docs/$((next_release)).0/_index.md
sed -i.bak 's/(Development)/(RC)/' ./content/${lang}/docs/$((next_release-1)).0/_index.md
sed -i.bak 's/Under construction, development release./Release Candidate./' ./content/${lang}/docs/$((next_release-1)).0/_index.md
rm -f ./content/${lang}/docs/$((next_release)).0/_index.md.bak
rm -f ./content/${lang}/docs/$((next_release-1)).0/_index.md.bak
done
sed -i.bak 's/current = "'$((next_release-2))'.0"/current = "'$((next_release-1))'.0"/' ./config.toml
sed -i.bak 's/next = "'$((next_release-1))'.0"/next = "'$((next_release))'.0"/' ./config.toml
rm -f ./config.toml.bak