diff --git a/CHANGELOG.md b/CHANGELOG.md index 0681f214..a4236d57 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ * Disabled continuous deployment in GHA. See `.github/workflows/build_artifact.yml` for details * `M` now marks the current row to the given letter on the keyboard +* `--version` now states `Unknown` if the git tag/hash cannot be found * Resolve crash when user tries to switch top or bottom line outside of scope * Resolved crash when the user tries to `delete word` past the end of a line diff --git a/cmake/version.cmake b/cmake/version.cmake index 8e6f2144..f3041034 100644 --- a/cmake/version.cmake +++ b/cmake/version.cmake @@ -13,7 +13,11 @@ function(version_setup) OUTPUT_STRIP_TRAILING_WHITESPACE ) - set(GIT_VERSION "${GIT_TAG} (${GIT_HASH})") + if(NOT GIT_TAG OR NOT GIT_HASH) + set(GIT_VERSION "Unknown") + else() + set(GIT_VERSION "${GIT_TAG} (${GIT_HASH})") + endif() string(TIMESTAMP COMPILE_DATE "%Y/%m/%d") if(CMAKE_BUILD_TYPE STREQUAL "")