From 3bbc33f5546cee39e33762a0d96f3147b35cea77 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Thu, 29 Feb 2024 13:03:41 +0100 Subject: [PATCH] Add support for Github SED inserted SHA_SHORT --- tasmota/include/tasmota_version.h | 2 ++ tasmota/tasmota.ino | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/tasmota/include/tasmota_version.h b/tasmota/include/tasmota_version.h index 97a994b8a..a3361edf1 100644 --- a/tasmota/include/tasmota_version.h +++ b/tasmota/include/tasmota_version.h @@ -20,6 +20,8 @@ #ifndef _TASMOTA_VERSION_H_ #define _TASMOTA_VERSION_H_ +#define TASMOTA_SHA_SHORT // Filled by Github sed + const uint32_t TASMOTA_VERSION = 0x0D040001; // 13.4.0.1 #endif // _TASMOTA_VERSION_H_ diff --git a/tasmota/tasmota.ino b/tasmota/tasmota.ino index ca4b0a1f5..d58d042aa 100644 --- a/tasmota/tasmota.ino +++ b/tasmota/tasmota.ino @@ -715,7 +715,8 @@ void setup(void) { } // Thehackbox inserts "release" or "commit number" before compiling using sed -i -e 's/PSTR("(%s)")/PSTR("(85cff52-%s)")/g' tasmota.ino - snprintf_P(TasmotaGlobal.image_name, sizeof(TasmotaGlobal.image_name), PSTR("(%s)"), PSTR(CODE_IMAGE_STR)); // Results in (85cff52-tasmota) or (release-tasmota) + // Github inserts "release" or "commit number" before compiling using sed -i -e 's/TASMOTA_SHA_SHORT/TASMOTA_SHA_SHORT 85cff52-/g' tasmota_version.h + snprintf_P(TasmotaGlobal.image_name, sizeof(TasmotaGlobal.image_name), PSTR("(" STR(TASMOTA_SHA_SHORT) "%s)"), PSTR(CODE_IMAGE_STR)); // Results in (85cff52-tasmota) or (release-tasmota) Format(TasmotaGlobal.mqtt_client, SettingsText(SET_MQTT_CLIENT), sizeof(TasmotaGlobal.mqtt_client)); Format(TasmotaGlobal.mqtt_topic, SettingsText(SET_MQTT_TOPIC), sizeof(TasmotaGlobal.mqtt_topic));