mirror of
https://github.com/GTAmodding/re3.git
synced 2024-12-27 22:55:40 +00:00
Merge pull request #1188 from mssx86/echo_to_printf
fix: printHash.sh; replace echo -n, check if $1 is set.
This commit is contained in:
commit
164623d58e
1 changed files with 11 additions and 9 deletions
20
printHash.sh
20
printHash.sh
|
@ -1,12 +1,14 @@
|
|||
#!/usr/bin/env bash
|
||||
#!/usr/bin/env sh
|
||||
if [ -z "${1}" ]
|
||||
then
|
||||
printf "%s\n" "Input the path to the file for writing the commit hash to."
|
||||
else
|
||||
printf "%s" "#define GIT_SHA1 \"" > $1
|
||||
|
||||
> $1
|
||||
if (command -v "git" >/dev/null) then
|
||||
git rev-parse --short HEAD | tr -d '\n' >> $1
|
||||
fi
|
||||
|
||||
echo -n "#define GIT_SHA1 \"" > $1
|
||||
|
||||
if (command -v "git" >/dev/null) then
|
||||
git rev-parse --short HEAD | tr -d '\n' >> $1
|
||||
printf "%s\n" "\"" >> $1
|
||||
printf "%s\n" "const char* g_GIT_SHA1 = GIT_SHA1;" >> $1
|
||||
fi
|
||||
|
||||
echo "\"" >> $1
|
||||
echo "const char* g_GIT_SHA1 = GIT_SHA1;" >> $1
|
Loading…
Reference in a new issue