]> prime8.dev >> repos - ttyd.git/commitdiff
cmake: update git command args (#293)
authorShuanglei Tao <tsl0922@gmail.com>
Thu, 18 Jun 2020 14:53:43 +0000 (22:53 +0800)
committerShuanglei Tao <tsl0922@gmail.com>
Thu, 18 Jun 2020 14:54:21 +0000 (22:54 +0800)
CMakeLists.txt

index efd76d2688da5e39899877c36552cf57ea25a13e..f08fc000a7b38c38f1b1c17bb36dd25c39a8c440 100644 (file)
@@ -6,8 +6,7 @@ set(PROJECT_VERSION "1.6.0")
 find_package(Git)
 if(GIT_FOUND)
     execute_process(
-            COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD
-            WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
+            COMMAND ${GIT_EXECUTABLE} --git-dir ${CMAKE_CURRENT_SOURCE_DIR}/.git rev-parse --short HEAD
             RESULT_VARIABLE GIT_RET
             OUTPUT_VARIABLE GIT_COMMIT
             OUTPUT_STRIP_TRAILING_WHITESPACE