summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorerorcun <erorcunerorcun@hotmail.com.tr>2021-02-12 15:23:29 +0100
committererorcun <erorcunerorcun@hotmail.com.tr>2021-02-12 19:10:39 +0100
commit80e4b3db55870f4b1947a757843a96909e300206 (patch)
treedc7243decd3ca33ed9c35d7bb1addc3dad19e8e7
parentCmake version for hash (diff)
downloadre3-80e4b3db55870f4b1947a757843a96909e300206.tar
re3-80e4b3db55870f4b1947a757843a96909e300206.tar.gz
re3-80e4b3db55870f4b1947a757843a96909e300206.tar.bz2
re3-80e4b3db55870f4b1947a757843a96909e300206.tar.lz
re3-80e4b3db55870f4b1947a757843a96909e300206.tar.xz
re3-80e4b3db55870f4b1947a757843a96909e300206.tar.zst
re3-80e4b3db55870f4b1947a757843a96909e300206.zip
Diffstat (limited to '')
-rw-r--r--premake5.lua2
-rwxr-xr-x[-rw-r--r--]printHash.sh6
2 files changed, 3 insertions, 5 deletions
diff --git a/premake5.lua b/premake5.lua
index 98c3788f..319e689a 100644
--- a/premake5.lua
+++ b/premake5.lua
@@ -331,7 +331,7 @@ project "reVC"
prebuildcommands { '"%{prj.location}..\\printHash.bat" "%{prj.location}..\\src\\extras\\GitSHA1.cpp"' }
filter "platforms:not win*"
- prebuildcommands { '"%{prj.location}../printHash.sh" "%{prj.location}../src/extras/GitSHA1.cpp"' }
+ prebuildcommands { '"%{prj.location}/../printHash.sh" "%{prj.location}/../src/extras/GitSHA1.cpp"' }
filter "platforms:win*glfw*"
staticruntime "off"
diff --git a/printHash.sh b/printHash.sh
index 7b4453a1..71f54466 100644..100755
--- 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