1
0
Fork 0
mirror of synced 2024-06-27 02:20:36 +12:00

feat: Update data folder check

This commit is contained in:
Cristian 2020-08-18 12:53:46 -05:00 committed by Cristian Vargas
parent 874403e667
commit c16fdf1b47
3 changed files with 2 additions and 7 deletions

View file

@ -878,8 +878,8 @@ def check_data_folder(out_dir: Optional[str]=None, config: ConfigDict=CONFIG) ->
output_dir = out_dir or config['OUTPUT_DIR']
assert isinstance(output_dir, str)
json_index_exists = os.path.exists(os.path.join(output_dir, JSON_INDEX_FILENAME))
if not json_index_exists:
sql_index_exists = os.path.exists(os.path.join(output_dir, SQL_INDEX_FILENAME))
if not sql_index_exists:
stderr('[X] No archivebox index found in the current directory.', color='red')
stderr(f' {output_dir}', color='lightyellow')
stderr()
@ -891,7 +891,6 @@ def check_data_folder(out_dir: Optional[str]=None, config: ConfigDict=CONFIG) ->
stderr(' archivebox init')
raise SystemExit(2)
sql_index_exists = os.path.exists(os.path.join(output_dir, SQL_INDEX_FILENAME))
from ..index.sql import list_migrations
pending_migrations = [name for status, name in list_migrations() if not status]

View file

@ -11,7 +11,6 @@ from collections import OrderedDict
from contextlib import contextmanager
from urllib.parse import urlparse
from ..system import atomic_write
from ..util import (
scheme,
enforce_types,
@ -25,7 +24,6 @@ from ..config import (
OUTPUT_DIR,
TIMEOUT,
URL_BLACKLIST_PTN,
ANSI,
stderr,
OUTPUT_PERMISSIONS
)
@ -45,7 +43,6 @@ from .html import (
write_html_link_details,
)
from .json import (
parse_json_main_index,
write_json_main_index,
parse_json_link_details,
write_json_link_details,

View file

@ -47,7 +47,6 @@ from .index.json import (
parse_json_links_details,
)
from .index.sql import (
parse_sql_main_index,
get_admins,
apply_migrations,
remove_from_sql_main_index,