mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2025-05-24 03:36:55 -04:00
move main funcs into cli files and switch to using click for CLI
This commit is contained in:
parent
569081a9eb
commit
328eb98a38
35 changed files with 1885 additions and 2296 deletions
archivebox/cli
|
@ -9,7 +9,27 @@ from typing import Optional, List, IO
|
|||
|
||||
from archivebox.misc.util import docstring
|
||||
from archivebox.config import DATA_DIR
|
||||
from ..main import manage
|
||||
|
||||
|
||||
|
||||
# @enforce_types
|
||||
def manage(args: Optional[List[str]]=None, out_dir: Path=DATA_DIR) -> None:
|
||||
"""Run an ArchiveBox Django management command"""
|
||||
|
||||
check_data_folder()
|
||||
from django.core.management import execute_from_command_line
|
||||
|
||||
if (args and "createsuperuser" in args) and (IN_DOCKER and not SHELL_CONFIG.IS_TTY):
|
||||
stderr('[!] Warning: you need to pass -it to use interactive commands in docker', color='lightyellow')
|
||||
stderr(' docker run -it archivebox manage {}'.format(' '.join(args or ['...'])), color='lightyellow')
|
||||
stderr('')
|
||||
|
||||
# import ipdb; ipdb.set_trace()
|
||||
|
||||
execute_from_command_line(['manage.py', *(args or ['help'])])
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@docstring(manage.__doc__)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue