From ae5c8f2bf8ac701dd49b01d06efc28756dc936ff Mon Sep 17 00:00:00 2001 From: Nick Sweeting Date: Wed, 8 Jun 2022 19:57:38 -0700 Subject: [PATCH] fix newline included in commit hash --- archivebox/main.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/archivebox/main.py b/archivebox/main.py index 86d2d172..beeb9e84 100755 --- a/archivebox/main.py +++ b/archivebox/main.py @@ -220,15 +220,14 @@ def version(quiet: bool=False, COMMIT_HASH = None try: - COMMIT_HASH = list((PACKAGE_DIR / '../.git/refs/heads/').glob('*'))[0].read_text() + COMMIT_HASH = list((PACKAGE_DIR / '../.git/refs/heads/').glob('*'))[0].read_text().strip() except Exception as e: - print(e) pass p = platform.uname() print( 'ArchiveBox v{}'.format(VERSION), - *((COMMIT_HASH[7:],) if COMMIT_HASH else ()), + *((COMMIT_HASH[:7],) if COMMIT_HASH else ()), sys.implementation.name.title(), p.system, platform.platform(), @@ -251,6 +250,10 @@ def version(quiet: bool=False, print('{white}[i] Dependency versions:{reset}'.format(**ANSI)) for name, dependency in DEPENDENCIES.items(): print(printable_dependency_version(name, dependency)) + + # add a newline between core dependencies and extractor dependencies for easier reading + if 'sqlite' in name.lower(): + print() print() print('{white}[i] Source-code locations:{reset}'.format(**ANSI))