|
|
|
@ -32,6 +32,8 @@ from cli.rsync import Rsync
|
|
|
|
|
console = Console()
|
|
|
|
|
sync = typer.Typer()
|
|
|
|
|
|
|
|
|
|
skip_error = "[yellow b]Skippped[/] because the [red b]path was unavailable[/]."
|
|
|
|
|
|
|
|
|
|
@sync.command()
|
|
|
|
|
def one(
|
|
|
|
|
label: str = typer.Option(
|
|
|
|
@ -42,12 +44,16 @@ def one(
|
|
|
|
|
):
|
|
|
|
|
"""
|
|
|
|
|
[green b]Sync[/] a [yellow]source[/] with the [yellow b]label[/] and its backups.
|
|
|
|
|
[yellow b]Skips[/] if not available.
|
|
|
|
|
"""
|
|
|
|
|
if label is None:
|
|
|
|
|
label = LabelPrompt.get_label_fzf()
|
|
|
|
|
src = Source.get_source(label)
|
|
|
|
|
rsync = Rsync(str(src.args))
|
|
|
|
|
for dest in src.destinations:
|
|
|
|
|
if not dest.path.is_exists():
|
|
|
|
|
console.print(skip_error)
|
|
|
|
|
continue
|
|
|
|
|
rsync.run_one(str(src.source), str(dest))
|
|
|
|
|
|
|
|
|
|
@sync.command()
|
|
|
|
|