mirror of
https://gitlab.com/KKlochko/tui-rsync.git
synced 2026-08-12 17:57:43 +00:00
(Added) path checking function.
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user