Verified Commit 62ec11f4 authored by Lars Bilke's avatar Lars Bilke

[CMake] Fix git branch detection on CI.

parent 235d6286
......@@ -29,12 +29,16 @@ if(NOT IS_GIT_REPO)
endif()
if(IS_GIT_REPO)
execute_process(
COMMAND ${GIT_EXECUTABLE} rev-parse --abbrev-ref HEAD
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
OUTPUT_VARIABLE OGS_GIT_BRANCH
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if(DEFINED ENV{CI_COMMIT_BRANCH})
set(OGS_GIT_BRANCH $ENV{CI_COMMIT_BRANCH})
else()
execute_process(
COMMAND ${GIT_EXECUTABLE} rev-parse --abbrev-ref HEAD
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
OUTPUT_VARIABLE OGS_GIT_BRANCH
OUTPUT_STRIP_TRAILING_WHITESPACE
)
endif()
endif()
if(IS_GIT_REPO AND NOT OGS_VERSION)
......
......@@ -4,6 +4,8 @@ title = "Welcome!"
author = "Lars Bilke"
weight = 1001
aliases = ["/docs/devguide"]
[menu.docs]
name = "Developer Guide"
identifier = "devguide"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment