I’m trying to use the Projucer “Post Export Shell Command” to write the current git hash to a file in the form:
#define GIT_COMMIT_ID "3c5f09ab"
In bash no problemo, but
cmd.exe is giving me headaches. I managed to execute it in
PowerShell, but the Projucer seems to be using
cmd.exe only. The PowerShell command would be
"#define GIT_COMMIT_ID `"$(git --git-dir %%1%%\.git rev-parse --short HEAD)`"" > %%1%%\Source\GitCommitId.h
cmd I’ve only managed to output the hash itself, like so:
git --git-dir %%1%%\.git rev-parse --short HEAD > %%1%%\Source\GitCommitId.h
which doesn’t help either, because I still need to prepend the
#define GIT_COMMIT_ID . Any cmd wizards out here who know how to achieve this?