spcd/pidd/cmd.py
2024-06-24 15:27:49 +02:00

56 lines
1.1 KiB
Python

def pidd_browse_workspace() -> None:
browse(project.root)
def pidd_build_project() -> None:
for extension in ["py", "sh"]:
path = Path(project.root) / f"build.{extension}"
if path.exists():
ps.run(path)
break
else:
pass
def pidd_clone_branch() -> None:
log.info(projects)
split()
log.info(project)
split()
log.info(f"""\
{project.url}
""")
ps.run(
"git",
"clone",
"--branch",
project.branch,
"--",
project.url,
project.root,
)
def pidd_list_environment() -> None:
for variable, value in sorted(projects.environment.items()):
log.info(f"{variable} = {value}")
def pidd_synchronize() -> None:
host = "rwx.work"
source = "out"
user = "cd"
#
root = Path(os.sep) / user / project.branch / projects.group / project.name
#
target = f"{user}@{host}:{root}"
ps.run(
"rsync",
"--archive",
"--delete-before",
"--verbose",
f"{source}/",
f"{target}/",
"--dry-run",
)