mirror of
https://github.com/ArchiveBox/ArchiveBox
synced 2024-11-22 20:23:12 +00:00
Update config.py to use fallback git head method
This commit is contained in:
parent
5805e18380
commit
487e560e32
1 changed files with 8 additions and 1 deletions
|
@ -398,6 +398,13 @@ def get_commit_hash(config) -> Optional[str]:
|
|||
commit_hash = git_dir.joinpath(ref).read_text().strip()
|
||||
return commit_hash
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
try:
|
||||
return list((config['PACKAGE_DIR'] / '../.git/refs/heads/').glob('*'))[0].read_text().strip()
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
return None
|
||||
|
||||
def get_build_time(config) -> str:
|
||||
|
|
Loading…
Reference in a new issue