From 9e1c048e206d4e91d03ef8978bf61a6af654fc3b Mon Sep 17 00:00:00 2001 From: erorcun Date: Fri, 12 Feb 2021 01:49:09 +0300 Subject: Remove version text, add toggleable debug info(with commit hash!) --- printHash.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 printHash.sh (limited to 'printHash.sh') diff --git a/printHash.sh b/printHash.sh new file mode 100644 index 00000000..7b4453a1 --- /dev/null +++ b/printHash.sh @@ -0,0 +1,14 @@ +#!/usr/bin/bash + +> $1 + +echo -n "#define GIT_SHA1 \"" > $1 + +git --version 2>&1 >/dev/null +GIT_IS_AVAILABLE=$? +if [ $GIT_IS_AVAILABLE -ne 0 ]; then +git rev-parse --short HEAD | tr -d '\n' >> $1 +fi + +echo "\"" >> $1 +echo "const char* g_GIT_SHA1 = GIT_SHA1;" >> $1 \ No newline at end of file -- cgit v1.2.3 From 8659b9d77c0a823f18a08fcea53a62dc29188529 Mon Sep 17 00:00:00 2001 From: erorcun Date: Fri, 12 Feb 2021 17:23:29 +0300 Subject: Fix sha1 on premake linux --- printHash.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) mode change 100644 => 100755 printHash.sh (limited to 'printHash.sh') diff --git a/printHash.sh b/printHash.sh old mode 100644 new mode 100755 index 7b4453a1..71f54466 --- a/printHash.sh +++ b/printHash.sh @@ -1,12 +1,10 @@ -#!/usr/bin/bash +#!/bin/bash > $1 echo -n "#define GIT_SHA1 \"" > $1 -git --version 2>&1 >/dev/null -GIT_IS_AVAILABLE=$? -if [ $GIT_IS_AVAILABLE -ne 0 ]; then +if (command -v "git" >/dev/null) then git rev-parse --short HEAD | tr -d '\n' >> $1 fi -- cgit v1.2.3