浏览代码

fix newline included in commit hash

Nick Sweeting 3 年之前
父节点
当前提交
ae5c8f2bf8
共有 1 个文件被更改,包括 6 次插入3 次删除
  1. 6 3
      archivebox/main.py

+ 6 - 3
archivebox/main.py

@@ -220,15 +220,14 @@ def version(quiet: bool=False,
         
         
         COMMIT_HASH = None
         COMMIT_HASH = None
         try:
         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:
         except Exception as e:
-            print(e)
             pass
             pass
         
         
         p = platform.uname()
         p = platform.uname()
         print(
         print(
             'ArchiveBox v{}'.format(VERSION),
             'ArchiveBox v{}'.format(VERSION),
-            *((COMMIT_HASH[7:],) if COMMIT_HASH else ()),
+            *((COMMIT_HASH[:7],) if COMMIT_HASH else ()),
             sys.implementation.name.title(),
             sys.implementation.name.title(),
             p.system,
             p.system,
             platform.platform(),
             platform.platform(),
@@ -251,6 +250,10 @@ def version(quiet: bool=False,
         print('{white}[i] Dependency versions:{reset}'.format(**ANSI))
         print('{white}[i] Dependency versions:{reset}'.format(**ANSI))
         for name, dependency in DEPENDENCIES.items():
         for name, dependency in DEPENDENCIES.items():
             print(printable_dependency_version(name, dependency))
             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()
         print('{white}[i] Source-code locations:{reset}'.format(**ANSI))
         print('{white}[i] Source-code locations:{reset}'.format(**ANSI))