From 461303c7364b4959c5ccfe111d9c13e3d0f8c08d Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Tue, 30 Jul 2024 19:39:11 +0200 Subject: [PATCH] synchronize --- spcd/cmd.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/spcd/cmd.py b/spcd/cmd.py index bd1fc7b..07a942a 100644 --- a/spcd/cmd.py +++ b/spcd/cmd.py @@ -22,12 +22,18 @@ def spcd_build_project() -> None: pass -def spcd_synchronize() -> None: - host = env.SPCD_PROJECT_PATH - source = "out" - user = "cd" - root = Path(os.sep) / user / project.branch / projects.group / project.name - target = f"{user}@{host}:{root}" +def spcd_synchronize( + target: str | None = None, source: str | None = None +) -> None: + if not target: + user = "cd" + host = env.SPCD_PROJECT_PATH + root = ( + Path(os.sep) / user / project.branch / projects.group / project.name + ) + target = f"{user}@{host}:{root}" + if not source: + source = "out" ps.run( "rsync", "--archive",