mirror of
https://github.com/neovim/neovim.git
synced 2025-12-10 16:42:42 +00:00
build: only manipulate out if getting the timestamp was successful
This fixes an issue seen in #1548, though the real problem is something different.
This commit is contained in:
@@ -158,11 +158,12 @@ function(git_timestamp _var)
|
|||||||
OUTPUT_VARIABLE out
|
OUTPUT_VARIABLE out
|
||||||
ERROR_QUIET
|
ERROR_QUIET
|
||||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
if(NOT res EQUAL 0)
|
if(res EQUAL 0)
|
||||||
|
string(REGEX REPLACE "[-\" :]" "" out ${out})
|
||||||
|
string(SUBSTRING ${out} 0 12 out)
|
||||||
|
else()
|
||||||
set(out "${out}-${res}-NOTFOUND")
|
set(out "${out}-${res}-NOTFOUND")
|
||||||
endif()
|
endif()
|
||||||
string(REGEX REPLACE "[-\" :]" "" out ${out})
|
|
||||||
string(SUBSTRING ${out} 0 12 out)
|
|
||||||
|
|
||||||
set(${_var} ${out} PARENT_SCOPE)
|
set(${_var} ${out} PARENT_SCOPE)
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|||||||
Reference in New Issue
Block a user