Add tag in version info
Signed-off-by: YoungSoo Shin <shinys000114@gmail.com>
This commit is contained in:
@@ -77,4 +77,13 @@ execute_process(
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
|
||||
add_compile_definitions(VERSION_HASH="${GIT_HASH}")
|
||||
add_compile_definitions(VERSION_HASH="${GIT_HASH}")
|
||||
|
||||
execute_process(
|
||||
COMMAND git describe --tags --abbrev=0
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
OUTPUT_VARIABLE GIT_TAG
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
|
||||
add_compile_definitions(VERSION_TAG="${GIT_TAG}")
|
||||
@@ -15,7 +15,7 @@
|
||||
void app_main(void)
|
||||
{
|
||||
printf("\n\n== ODROID POWER-MATE ===\n");
|
||||
printf("Versgition: %s\n\n", VERSION_HASH);
|
||||
printf("Version: %s-%s\n\n", VERSION_TAG, VERSION_HASH);
|
||||
|
||||
ESP_ERROR_CHECK(i2cdev_init());
|
||||
init_led();
|
||||
|
||||
@@ -82,7 +82,7 @@ static esp_err_t version_get_handler(httpd_req_t* req)
|
||||
{
|
||||
httpd_resp_set_type(req, "application/json");
|
||||
char buf[100];
|
||||
sprintf(buf, "{\"version\": \"%s\"}", VERSION_HASH);
|
||||
sprintf(buf, "{\"version\": \"%s-%s\"}", VERSION_TAG, VERSION_HASH);
|
||||
httpd_resp_send(req, buf, strlen(buf));
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user