use new is_mount and COMMIT_HASH config options

This commit is contained in:
Nick Sweeting 2022-06-08 20:13:22 -07:00 committed by GitHub
parent 9f90a2d60d
commit ccce4a6a2f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -96,6 +96,7 @@ from .config import (
check_data_folder, check_data_folder,
write_config_file, write_config_file,
VERSION, VERSION,
COMMIT_HASH,
CODE_LOCATIONS, CODE_LOCATIONS,
EXTERNAL_LOCATIONS, EXTERNAL_LOCATIONS,
DATA_LOCATIONS, DATA_LOCATIONS,
@ -213,16 +214,9 @@ def version(quiet: bool=False,
print(VERSION) print(VERSION)
if not quiet: if not quiet:
# 0.5.6 # 0.6.3
# ArchiveBox v0.5.6 Cpython Linux Linux-4.19.121-linuxkit-x86_64-with-glibc2.28 x86_64 (in Docker) (in TTY) # ArchiveBox v0.6.3 Cpython Linux Linux-4.19.121-linuxkit-x86_64-with-glibc2.28 x86_64 (in Docker) (in TTY)
# DEBUG=False IN_DOCKER=True IS_TTY=True TZ=UTC FS_ATOMIC=True FS_REMOTE=False FS_PERMS=644 501:20 SEARCH_BACKEND=ripgrep # DEBUG=False IN_DOCKER=True IS_TTY=True TZ=UTC FS_ATOMIC=True FS_REMOTE=False FS_PERMS=644 501:20 SEARCH_BACKEND=ripgrep
# DEBUG=False IN_DOCKER=True IS_TTY=True TZ=UTC FS_ATOMIC=True FS_REMOTE=False FS_PERMS=644 501:20 SEARCH_BACKEND=ripgrepw
COMMIT_HASH = None
try:
COMMIT_HASH = list((PACKAGE_DIR / '../.git/refs/heads/').glob('*'))[0].read_text().strip()
except Exception as e:
pass
p = platform.uname() p = platform.uname()
print( print(
@ -233,7 +227,7 @@ def version(quiet: bool=False,
platform.platform(), platform.platform(),
p.machine, p.machine,
) )
OUTPUT_IS_REMOTE_FS = bool(os.path.ismount(OUTPUT_DIR) or os.path.ismount(ARCHIVE_DIR)) OUTPUT_IS_REMOTE_FS = DATA_LOCATIONS['OUTPUT_DIR']['is_mount'] or DATA_LOCATIONS['ARCHIVE_DIR']['is_mount']
print( print(
f'DEBUG={DEBUG}', f'DEBUG={DEBUG}',
f'IN_DOCKER={IN_DOCKER}', f'IN_DOCKER={IN_DOCKER}',