Skip to content

Commit

Permalink
Update versions in the index only if the conversion is successful
Browse files Browse the repository at this point in the history
  • Loading branch information
cbonte committed May 26, 2012
1 parent 653c8b2 commit 75babe0
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions tools/generate-docs.sh
Expand Up @@ -96,15 +96,17 @@ if [ "$force" == 1 -o "$updated" == "1" -o "$updated14" == "1" ];
then
echo "Generating documentation for HAProxy 1.4..."
cd $WORK_DIR/haproxy-dconv/master || exit 1
./haproxy-dconv.py -i ../../haproxy/1.4/doc/configuration.txt -o ../gh-pages/configuration-1.4.html
./haproxy-dconv.py -i ../../haproxy/1.4/doc/configuration.txt -o ../gh-pages/configuration-1.4.html &&
sed -i "s/\(<\!-- VERSION-1\.5 -->\)\(.*\)\(<\!-- \/VERSION-1\.5 -->\)/\1${haproxy15_git_version}\3/" ../gh-pages/index.html
cd $PROJECT_HOME
fi

if [ "$force" == 1 -o "$updated" == "1" -o "$updated15" == "1" ];
then
echo "Generating documentation for HAProxy 1.5..."
cd $WORK_DIR/haproxy-dconv/master || exit 1
./haproxy-dconv.py -i ../../haproxy/1.5/doc/configuration.txt -o ../gh-pages/configuration-1.5.html
./haproxy-dconv.py -i ../../haproxy/1.5/doc/configuration.txt -o ../gh-pages/configuration-1.5.html &&
sed -i "s/\(<\!-- VERSION-1\.4 -->\)\(.*\)\(<\!-- \/VERSION-1\.4 -->\)/\1${haproxy14_git_version}\3/" ../gh-pages/index.html
cd $PROJECT_HOME
fi

Expand All @@ -116,9 +118,6 @@ echo "Synchronize generated documentations..."
cd $WORK_DIR/haproxy-dconv/gh-pages || exit 1
push=0

sed -i "s/\(<\!-- VERSION-1\.4 -->\)\(.*\)\(<\!-- \/VERSION-1\.4 -->\)/\1${haproxy14_git_version}\3/" index.html
sed -i "s/\(<\!-- VERSION-1\.5 -->\)\(.*\)\(<\!-- \/VERSION-1\.5 -->\)/\1${haproxy15_git_version}\3/" index.html

rsync -av --delete ../master/bootstrap/ bootstrap/ &&
if [ "$(git status -s bootstrap/)" != "" ];
then
Expand Down

0 comments on commit 75babe0

Please sign in to comment.