release.sh: website: fix feeding the latest stable and rc

Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
This commit is contained in:
Nicolas Sebrecht 2015-03-20 12:46:08 +01:00
parent 4015c1d84c
commit 509d1404b0

View File

@ -257,17 +257,19 @@ function git_release () {
}
function get_last_rc () {
git tag | grep -E '^v([0-9][\.-]){3}rc' | sort -n | tail -n1
}
#
# $1: new version
#
function get_last_stable () {
git tag | grep -E '^v([0-9][\.])+' | grep -v '\-rc' | sort -n | tail -n1
}
function update_website_releases_info() {
cat > "$WEBSITE_LATEST" <<EOF
# DO NOT EDIT MANUALLY: it is generated by a script (release.sh)
stable: $1
stable: $(get_last_stable)
rc: $(get_last_rc)
EOF
}
@ -277,7 +279,6 @@ EOF
#
function update_website () {
debug 'in update_website'
update_website_releases_info $1
ask "update API of the website? (require $SPHINXBUILD)"
if test $? -eq $Yes
@ -289,6 +290,8 @@ function update_website () {
echo "git stash create 'WIP during offlineimap API import'"
git stash create 'WIP during offlineimap API import'
}
update_website_releases_info
cd "../$DOCSDIR"
make websitedoc && {
cd ../website && {