mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2025-05-13 06:34:25 -04:00
print import instructions on first run
This commit is contained in:
parent
749f06fe5b
commit
fd80275856
3 changed files with 23 additions and 5 deletions
|
@ -1,4 +0,0 @@
|
|||
|
||||
__AUTHOR__ = 'Nick Sweeting <git@nicksweeting.com>'
|
||||
__DESCRIPTION__ = 'ArchiveBox: The self-hosted internet archive.'
|
||||
__DOCUMENTATION__ = 'https://github.com/pirate/ArchiveBox/wiki'
|
|
@ -62,8 +62,26 @@ def parse_args(args=None):
|
|||
return command.subcommand, command.args
|
||||
|
||||
|
||||
def print_import_tutorial():
|
||||
print('Welcome to ArchiveBox!')
|
||||
print()
|
||||
print('To import an existing archive (from a previous version of ArchiveBox):')
|
||||
print(' 1. cd into your data dir OUTPUT_DIR (usually ArchiveBox/output) and run:')
|
||||
print(' 2. archivebox init')
|
||||
print()
|
||||
print('To start a new archive:')
|
||||
print(' 1. Create an emptry directory, then cd into it and run:')
|
||||
print(' 2. archivebox init')
|
||||
print()
|
||||
print('For more information, see the migration docs here:')
|
||||
print(' https://github.com/pirate/ArchiveBox/wiki/Migration')
|
||||
|
||||
def main(args=None):
|
||||
subcommand, subcommand_args = parse_args(args)
|
||||
if subcommand is None:
|
||||
print_import_tutorial()
|
||||
raise SystemExit(0)
|
||||
|
||||
run_subcommand(subcommand, subcommand_args)
|
||||
|
||||
|
||||
|
|
|
@ -28,7 +28,11 @@ def init(output_dir: str=OUTPUT_DIR):
|
|||
|
||||
if not is_empty:
|
||||
if existing_index:
|
||||
print('You already have an archive in this folder!')
|
||||
print('[√] You already have an archive setup up in this folder. To add new links, you can run:')
|
||||
print(' archivebox add https://example.com')
|
||||
print()
|
||||
print('[i] Fore more usage and examples, run "archivebox help" or visit:')
|
||||
print(' https://github.com/pirate/ArchiveBox/wiki/Usage')
|
||||
# TODO: import old archivebox version's archive data folder
|
||||
|
||||
raise SystemExit(1)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue