mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2025-05-12 22:25:44 -04:00
add manage command and shell welcome message
This commit is contained in:
parent
834aaa1591
commit
71402c3d09
5 changed files with 91 additions and 7 deletions
29
archivebox/cli/archivebox_manage.py
Normal file
29
archivebox/cli/archivebox_manage.py
Normal file
|
@ -0,0 +1,29 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
__package__ = 'archivebox.cli'
|
||||
__command__ = 'archivebox manage'
|
||||
__description__ = 'Run an ArchiveBox Django management command'
|
||||
|
||||
import sys
|
||||
|
||||
from ..legacy.config import OUTPUT_DIR, setup_django, check_data_folder
|
||||
|
||||
|
||||
def main(args=None):
|
||||
check_data_folder()
|
||||
|
||||
setup_django(OUTPUT_DIR)
|
||||
from django.core.management import execute_from_command_line
|
||||
|
||||
args = sys.argv if args is None else ['archivebox', *args]
|
||||
|
||||
args[0] = f'{sys.argv[0]} manage'
|
||||
|
||||
if args[1:] == []:
|
||||
args.append('help')
|
||||
|
||||
execute_from_command_line(args)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
Loading…
Add table
Add a link
Reference in a new issue