mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2025-05-13 06:34:25 -04:00
feat: Update data folder check
This commit is contained in:
parent
874403e667
commit
c16fdf1b47
3 changed files with 2 additions and 7 deletions
|
@ -878,8 +878,8 @@ def check_data_folder(out_dir: Optional[str]=None, config: ConfigDict=CONFIG) ->
|
||||||
output_dir = out_dir or config['OUTPUT_DIR']
|
output_dir = out_dir or config['OUTPUT_DIR']
|
||||||
assert isinstance(output_dir, str)
|
assert isinstance(output_dir, str)
|
||||||
|
|
||||||
json_index_exists = os.path.exists(os.path.join(output_dir, JSON_INDEX_FILENAME))
|
sql_index_exists = os.path.exists(os.path.join(output_dir, SQL_INDEX_FILENAME))
|
||||||
if not json_index_exists:
|
if not sql_index_exists:
|
||||||
stderr('[X] No archivebox index found in the current directory.', color='red')
|
stderr('[X] No archivebox index found in the current directory.', color='red')
|
||||||
stderr(f' {output_dir}', color='lightyellow')
|
stderr(f' {output_dir}', color='lightyellow')
|
||||||
stderr()
|
stderr()
|
||||||
|
@ -891,7 +891,6 @@ def check_data_folder(out_dir: Optional[str]=None, config: ConfigDict=CONFIG) ->
|
||||||
stderr(' archivebox init')
|
stderr(' archivebox init')
|
||||||
raise SystemExit(2)
|
raise SystemExit(2)
|
||||||
|
|
||||||
sql_index_exists = os.path.exists(os.path.join(output_dir, SQL_INDEX_FILENAME))
|
|
||||||
from ..index.sql import list_migrations
|
from ..index.sql import list_migrations
|
||||||
|
|
||||||
pending_migrations = [name for status, name in list_migrations() if not status]
|
pending_migrations = [name for status, name in list_migrations() if not status]
|
||||||
|
|
|
@ -11,7 +11,6 @@ from collections import OrderedDict
|
||||||
from contextlib import contextmanager
|
from contextlib import contextmanager
|
||||||
from urllib.parse import urlparse
|
from urllib.parse import urlparse
|
||||||
|
|
||||||
from ..system import atomic_write
|
|
||||||
from ..util import (
|
from ..util import (
|
||||||
scheme,
|
scheme,
|
||||||
enforce_types,
|
enforce_types,
|
||||||
|
@ -25,7 +24,6 @@ from ..config import (
|
||||||
OUTPUT_DIR,
|
OUTPUT_DIR,
|
||||||
TIMEOUT,
|
TIMEOUT,
|
||||||
URL_BLACKLIST_PTN,
|
URL_BLACKLIST_PTN,
|
||||||
ANSI,
|
|
||||||
stderr,
|
stderr,
|
||||||
OUTPUT_PERMISSIONS
|
OUTPUT_PERMISSIONS
|
||||||
)
|
)
|
||||||
|
@ -45,7 +43,6 @@ from .html import (
|
||||||
write_html_link_details,
|
write_html_link_details,
|
||||||
)
|
)
|
||||||
from .json import (
|
from .json import (
|
||||||
parse_json_main_index,
|
|
||||||
write_json_main_index,
|
write_json_main_index,
|
||||||
parse_json_link_details,
|
parse_json_link_details,
|
||||||
write_json_link_details,
|
write_json_link_details,
|
||||||
|
|
|
@ -47,7 +47,6 @@ from .index.json import (
|
||||||
parse_json_links_details,
|
parse_json_links_details,
|
||||||
)
|
)
|
||||||
from .index.sql import (
|
from .index.sql import (
|
||||||
parse_sql_main_index,
|
|
||||||
get_admins,
|
get_admins,
|
||||||
apply_migrations,
|
apply_migrations,
|
||||||
remove_from_sql_main_index,
|
remove_from_sql_main_index,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue