diff --git a/src/docs/build_doc_versions.sh b/src/docs/build_doc_versions.sh index 5370ef4..1f4cf8a 100644 --- a/src/docs/build_doc_versions.sh +++ b/src/docs/build_doc_versions.sh @@ -4,29 +4,20 @@ > doc_versions.txt MENU_PATCH='menudata.children.push({text:"Versions",url:"index.html",children:[' -# Get information about git environment (commit, releases, etc.) -GIT_DESC=$(git describe --tags --match 'v*') +# Get information about git environment (commit, release) +COMMIT_HASH=$(git rev-parse --short HEAD) CURR_RELEASE=$(git describe --tags --abbrev=0) -RESET_HASH=$(git rev-parse HEAD) -# Build current commit if not a release commit -if [[ "$GIT_DESC" =~ -([0-9]+)-([a-z0-9]{8}) ]] -then - COMMIT_HASH=$(git rev-parse --short HEAD) - mkdir $COMMIT_HASH && cd $COMMIT_HASH - - # Build current version - cmake -DOFT_BUILD_DOCS:BOOL=ON -DOFT_DOCS_ONLY:BOOL=ON -DOFT_PACKAGE_NIGHTLY:BOOL=ON ../../src - make docs - cd .. - echo $COMMIT_HASH >> doc_versions.txt - MENU_PATCH+='{text:"'$COMMIT_HASH'",url:"'../$COMMIT_HASH'/index.html"},' - - # Checkout most recent release - git checkout $CURR_RELEASE -fi +# Build current commit +mkdir latest && cd latest +cmake -DOFT_BUILD_DOCS:BOOL=ON -DOFT_DOCS_ONLY:BOOL=ON -DOFT_PACKAGE_NIGHTLY:BOOL=ON ../../src +make docs +cd .. +echo "latest" >> doc_versions.txt +MENU_PATCH+='{text:"'$COMMIT_HASH'",url:"../latest/index.html"},' # Build most recent release +git checkout $CURR_RELEASE mkdir $CURR_RELEASE && cd $CURR_RELEASE cmake -DOFT_BUILD_DOCS:BOOL=ON -DOFT_DOCS_ONLY:BOOL=ON -DOFT_PACKAGE_NIGHTLY:BOOL=OFF ../../src make docs