mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-10 09:32:06 +00:00
create_revision.sh: better
This commit is contained in:
parent
ad5fdc0e62
commit
982c2c5573
@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
mkdir -p "${CMAKE_CURRENT_BINARY_DIR}"/src
|
||||
echo "#ifndef REVISION" > ${CMAKE_CURRENT_BINARY_DIR}/src/revision.h
|
||||
echo -n "#define REVISION " >> ${CMAKE_CURRENT_BINARY_DIR}/src/revision.h
|
||||
mkdir -p "${CMAKE_CURRENT_BINARY_DIR}/src"
|
||||
echo "#ifndef REVISION" > "${CMAKE_CURRENT_BINARY_DIR}/src/revision.h"
|
||||
echo -n "#define REVISION " >> "${CMAKE_CURRENT_BINARY_DIR}/src/revision.h"
|
||||
|
||||
cd "${CMAKE_CURRENT_SOURCE_DIR}";
|
||||
|
||||
@ -15,6 +15,6 @@ revision=$(git tag --points-at HEAD 2> /dev/null | tail -1)
|
||||
if [[ "$revision" = "" ]]; then
|
||||
revision=$( ( git describe --tags || echo 1 ) | cut -d "-" -f 1 )
|
||||
fi
|
||||
echo $revision >> "${CMAKE_CURRENT_BINARY_DIR}"/src/revision.h;
|
||||
echo $revision >> "${CMAKE_CURRENT_BINARY_DIR}/src/revision.h";
|
||||
|
||||
echo "#endif" >> "${CMAKE_CURRENT_BINARY_DIR}"/src/revision.h
|
||||
echo "#endif" >> "${CMAKE_CURRENT_BINARY_DIR}/src/revision.h"
|
||||
|
Loading…
Reference in New Issue
Block a user