From 88266aa7ade72cbead087cf50b1e4e80efc7a082 Mon Sep 17 00:00:00 2001 From: Bryan Roe Date: Thu, 9 May 2019 15:27:56 -0700 Subject: [PATCH] updated '-info- to contain commit hash and date if available --- meshconsole/main.c | 6 ++++++ meshservice/ServiceMain.c | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/meshconsole/main.c b/meshconsole/main.c index b6e9405..600d7b5 100644 --- a/meshconsole/main.c +++ b/meshconsole/main.c @@ -31,6 +31,7 @@ limitations under the License. #include "microscript/ILibDuktape_ScriptContainer.h" #include "microstack/ILibCrypto.h" +#include "microscript/ILibDuktape_Commit.h" MeshAgentHostContainer *agentHost = NULL; @@ -131,6 +132,11 @@ char* crashMemory = ILib_POSIX_InstallCrashHandler(argv[0]); if (argc > 1 && strcasecmp(argv[1], "-info") == 0) { printf("Compiled on: %s, %s\n", __TIME__, __DATE__); + if (SOURCE_COMMIT_HASH != NULL && SOURCE_COMMIT_DATE != NULL) + { + printf(" Commit Hash: %s\n", SOURCE_COMMIT_HASH); + printf(" Commit Date: %s\n", SOURCE_COMMIT_DATE); + } #ifndef MICROSTACK_NOTLS printf("Using %s\n", SSLeay_version(SSLEAY_VERSION)); #endif diff --git a/meshservice/ServiceMain.c b/meshservice/ServiceMain.c index 78395eb..41927fc 100644 --- a/meshservice/ServiceMain.c +++ b/meshservice/ServiceMain.c @@ -35,6 +35,7 @@ limitations under the License. #include "microstack/ILibCrypto.h" #include "meshcore/agentcore.h" #include "microscript/ILibDuktape_ScriptContainer.h" +#include "microscript/ILibDuktape_Commit.h" #include #ifndef _MINCORE @@ -936,6 +937,11 @@ int main(int argc, char* argv[]) if (argc > 1 && strcasecmp(argv[1], "-info") == 0) { printf("Compiled on: %s, %s\n", __TIME__, __DATE__); + if (SOURCE_COMMIT_HASH != NULL && SOURCE_COMMIT_DATE != NULL) + { + printf(" Commit Hash: %s\n", SOURCE_COMMIT_HASH); + printf(" Commit Date: %s\n", SOURCE_COMMIT_DATE); + } #ifndef MICROSTACK_NOTLS printf("Using %s\n", SSLeay_version(SSLEAY_VERSION)); #endif