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 --- premake5.lua | 2 +- printHash.sh | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) mode change 100644 => 100755 printHash.sh diff --git a/premake5.lua b/premake5.lua index 8f1c8a92..d4459f94 100644 --- a/premake5.lua +++ b/premake5.lua @@ -331,7 +331,7 @@ project "re3" 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 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