MCPcopy
hub / github.com/ArchiveBox/ArchiveBox / get_commit_hash

Function get_commit_hash

archivebox/config.py:400–414  ·  view source on GitHub ↗
(config)

Source from the content-addressed store, hash-verified

398 raise Exception('Failed to detect installed archivebox version!')
399
400def get_commit_hash(config) -> Optional[str]:
401 try:
402 git_dir = config['PACKAGE_DIR'] / '../.git'
403 ref = (git_dir / 'HEAD').read_text().strip().split(' ')[-1]
404 commit_hash = git_dir.joinpath(ref).read_text().strip()
405 return commit_hash
406 except Exception:
407 pass
408
409 try:
410 return list((config['PACKAGE_DIR'] / '../.git/refs/heads/').glob('*'))[0].read_text().strip()
411 except Exception:
412 pass
413
414 return None
415
416def get_build_time(config) -> str:
417 if config['IN_DOCKER']:

Callers 1

config.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected