-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Expand file tree
/
Copy pathVERSION
More file actions
25 lines (18 loc) · 580 Bytes
/
VERSION
File metadata and controls
25 lines (18 loc) · 580 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# Mono Repo Global Version
__version__ = "0.9.6-beta.6"
# elsewhere we can call this file: `python VERSION` and simply take the stdout
# stdlib
import os
import subprocess
import sys
def get_version() -> str:
return __version__
def get_hash() -> str:
cwd = os.path.dirname(os.path.abspath(__file__))
output = subprocess.check_output("git rev-parse HEAD".split(" "), cwd=cwd)
return output.strip().decode("ascii")
if __name__ == "__main__":
if len(sys.argv) > 1 and "hash" in sys.argv[1]:
print(get_hash())
else:
print(get_version())