diff options
| author | Rémi Verschelde | 2017-07-11 16:37:25 +0200 |
|---|---|---|
| committer | GitHub | 2017-07-11 16:37:25 +0200 |
| commit | 3741a576575f3fef4f7c743e90856240d9f47ffc (patch) | |
| tree | 11a073ad528de287aa70859b8dd6cc34f9181bd2 /methods.py | |
| parent | 98a9c8fc5f6590e8233e766ec05dab527d5343ac (diff) | |
| parent | 5a9eb5ef58288506256998bcbc9c1fc20d4f50d1 (diff) | |
| download | godot-3741a576575f3fef4f7c743e90856240d9f47ffc.tar.gz godot-3741a576575f3fef4f7c743e90856240d9f47ffc.tar.zst godot-3741a576575f3fef4f7c743e90856240d9f47ffc.zip | |
Merge pull request #9589 from Noshyaar/ref
Include Git hash in the engine
Diffstat (limited to 'methods.py')
| -rw-r--r-- | methods.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/methods.py b/methods.py index 4d3d5ae34..abd87c07d 100644 --- a/methods.py +++ b/methods.py @@ -1176,6 +1176,20 @@ def update_version(): f.write("#define VERSION_STATUS " + str(version.status) + "\n") import datetime f.write("#define VERSION_YEAR " + str(datetime.datetime.now().year) + "\n") + f.close() + + fhash = open("core/version_hash.gen.h", "wb") + githash = "" + if os.path.isfile(".git/HEAD"): + head = open(".git/HEAD", "rb").readline().strip() + if head.startswith("ref: "): + head = ".git/" + head[5:] + if os.path.isfile(head): + githash = open(head, "rb").readline().strip() + else: + githash = head + fhash.write("#define VERSION_HASH \"" + githash + "\"") + fhash.close() def parse_cg_file(fname, uniforms, sizes, conditionals): |
