# HG changeset patch # User Vincent Hatakeyama <vincent.hatakeyama@xcg-consulting.fr> # Date 1472476755 -7200 # Mon Aug 29 15:19:15 2016 +0200 # Node ID 63cf5d2ab703aa1aa239200c3042528935398fa7 # Parent d9b0b4161f4047f27e7721d68d8466e35ff6a5d2 [create_documentation] use branch name (compatible with hg/git) diff --git a/create_documentation b/create_documentation --- a/create_documentation +++ b/create_documentation @@ -38,8 +38,11 @@ make -e SPHINXOPTS=-Dlanguage=${language} $format # TODO read value from Makefile builddir=_build - # TODO read value from hg/git - branch=default + if [ -e ".git" ]; then + branch="$(git rev-parse --abbrev-ref HEAD)" + elif [ -e ".hg" ]; then + branch="$(hg id -b)" + fi dest_dir=$out_dir/$project_name/$language/$branch if [[ $? -eq 0 ]] ; then echo "${YELLOW}INFO ${RESET} - Documentation generation done for $doc_dir (superproject), copy to $dest_dir" @@ -68,8 +71,11 @@ make -e SPHINXOPTS=-Dlanguage=${language} $format # TODO read value from Makefile builddir=_build - # TODO read value from hg/git - branch=default + if [ -e ".git" ]; then + branch="$(git rev-parse --abbrev-ref HEAD)" + elif [ -e ".hg" ]; then + branch="$(hg id -b)" + fi dest_dir=$out_dir/$module/$language/$branch if [[ $? -eq 0 ]] ; then echo ${YELLOW}INFO ${RESET} - Documentation generation done for $dir/$module/$doc_dir, copy to $dest_dir