MCPcopy
hub / github.com/PokemonGoF/PokemonGo-Bot / get_commit_hash

Function get_commit_hash

pokecli.py:153–167  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

151 return bot
152
153 def get_commit_hash():
154 try:
155 hash = subprocess.check_output(['git', 'rev-parse', 'HEAD'],
156 stderr=subprocess.STDOUT)
157 if all(c in string.hexdigits for c in hash[:-1]):
158 with open('version', 'w') as f:
159 f.write(hash)
160 except:
161 pass
162
163 if not os.path.exists('version'):
164 return 'unknown'
165
166 with open('version') as f:
167 return f.read()[:8]
168
169 try:
170 if six.PY2:

Callers 1

mainFunction · 0.85

Calls 1

readMethod · 0.80

Tested by

no test coverage detected