From cf18130f8558493c78ae0e510fd4f7d96c4af63b Mon Sep 17 00:00:00 2001 From: Cristian Date: Tue, 8 Sep 2020 10:53:11 -0500 Subject: [PATCH] feat: Add deprecation warning for index.json --- archivebox/main.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/archivebox/main.py b/archivebox/main.py index a9ac8ca6..834db258 100644 --- a/archivebox/main.py +++ b/archivebox/main.py @@ -255,6 +255,10 @@ def init(force: bool=False, out_dir: str=OUTPUT_DIR) -> None: os.makedirs(out_dir, exist_ok=True) is_empty = not len(set(os.listdir(out_dir)) - ALLOWED_IN_OUTPUT_DIR) + if (Path(out_dir) / JSON_INDEX_FILENAME).exists(): + stderr("[!] This folder contains a JSON index. It is deprecated, and will no longer be kept up to date automatically.", color="lightyellow") + stderr(" You can run `archivebox list --json --with-headers > index.json` to manually generate it.", color="lightyellow") + existing_index = (Path(out_dir) / SQL_INDEX_FILENAME).exists() if is_empty and not existing_index: