Commit a2183af7 authored by Cédric Traizet's avatar Cédric Traizet
Browse files

BUG: use commit hash to determine the branch name

parent ec242379
Pipeline #7565 passed with stages
in 82 minutes and 12 seconds
......@@ -39,13 +39,14 @@ SB_CMAKE_DIR_REL=$CUR_DIR/../../SuperBuild/CMake
SB_CMAKE_DIR=$(readlink -f "${SB_CMAKE_DIR_REL}")
cd "$CUR_DIR/../../" || echo "cannot cd to CUR_DIR/../../"
GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
GIT_HASH=$(git rev-parse --short HEAD)
GIT_BRANCH=$(git name-rev --name-only ${GIT_HASH})
# the version is the branch name for develop and release-X.Y branches and the commit short hash for other branches
if [[ ${GIT_BRANCH} =~ develop|release-+[0-9]+\.[0-9] ]] ; then
VERSION=${GIT_BRANCH}
else
VERSION=$(git rev-parse --short HEAD)
VERSION=${GIT_HASH}
fi
CMAKE_FILES=$(find "${SB_CMAKE_DIR}" -maxdepth 1 -type f -name "External_*")
......
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