From ad12c125a4e50185c599c6eb8277fd3da3753584 Mon Sep 17 00:00:00 2001 From: Nicolas Sebrecht Date: Tue, 7 Apr 2015 14:23:20 +0200 Subject: [PATCH] contrib/release.sh: fix latest.yml update Signed-off-by: Nicolas Sebrecht --- contrib/release.sh | 60 +++++++++++++++++++++++++++++----------------- 1 file changed, 38 insertions(+), 22 deletions(-) diff --git a/contrib/release.sh b/contrib/release.sh index e740cdc..cf029f0 100755 --- a/contrib/release.sh +++ b/contrib/release.sh @@ -271,6 +271,7 @@ rc: $(get_last_rc) EOF } + # # $1: new version # @@ -280,35 +281,50 @@ function update_website () { ask "update API of the website? (require $SPHINXBUILD)" if test $? -eq $Yes then - $SPHINXBUILD --version > /dev/null 2>&1 && { - cd website || echo "ERROR: cannot go to website" - git diff --quiet 2>/dev/null && git diff --quiet --cached 2>/dev/null || { - echo "There is WIP in the website repository, stashing" - 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 && { - branch_name="import-$1" - git checkout -b "$branch_name" - git add '_doc/versions' - git commit -a -s -m"update for offlineimap $1" - git checkout master - echo "website: branch '$branch_name' ready for a merge in master!" - } - } - } || { + # Check sphinx is available. + $SPHINXBUILD --version > /dev/null 2>&1 + if test ! $? -eq 0 + then echo "Oops! you don't have $SPHINXBUILD installed?" echo "Cannot update the webite documentation..." echo "You should install it and run:" echo " $ cd docs" echo " $ make websitedoc" echo "Then, commit and push changes of the website." + ask 'continue' + return + fi + + # Check website sources are available. + cd website + if test ! $? -eq 0 + then + echo "ERROR: cannot go to the website sources" + ask 'continue' + return + fi + # Stash any WIP in the website sources. + git diff --quiet 2>/dev/null && git diff --quiet --cached 2>/dev/null || { + echo "There is WIP in the website repository, stashing" + echo "git stash create 'WIP during offlineimap API import'" + git stash create 'WIP during offlineimap API import' + ask 'continue' } - ask 'continue' + + cd .. # Back to offlineimap.git. + update_website_releases_info + cd "./$DOCSDIR" # Enter the docs directory in offlineimap.git. + # Build the docs! + make websitedoc && { + # Commit changes in a branch. + cd ../website # Enter the website sources. + branch_name="import-$1" + git checkout -b "$branch_name" + git add '_doc/versions' + git commit -a -s -m"update for offlineimap $1" + echo "website: branch '$branch_name' ready for a merge in master!" + } + ask 'website updated locally; continue' fi }