From 2c5c28f36435f1d145e36a0c50624f978631857a Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 29 Jul 2024 14:20:15 +0200 Subject: [PATCH] list_environment_variables --- spcd/__init__.py | 11 ++++++++++- spcd/cmd.py | 9 --------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/spcd/__init__.py b/spcd/__init__.py index ef32424..f47533b 100644 --- a/spcd/__init__.py +++ b/spcd/__init__.py @@ -44,17 +44,26 @@ def install_commands(path: str) -> None: for command in [ "browse-workspace", "build-project", - "list-environment", "synchronize", ]: log.info(command) (user / f"{COMMANDS_PREFIX}{command}").symlink_to(path) +def list_environment_variables() -> None: + step("List environment variables") + for variable, value in sorted(projects.environment.items()): + if variable != "SPCD_SSH_KEY": + log.info(f"{variable} = {value}") + else: + log.info(f"{variable}") + + def main(main: str) -> None: path, *arguments = sys.argv name = Path(path).name if name == "__main__.py": + list_environment_variables() clone_project_branch() set_ssh() install_commands(main) diff --git a/spcd/cmd.py b/spcd/cmd.py index 1e72336..bd1fc7b 100644 --- a/spcd/cmd.py +++ b/spcd/cmd.py @@ -3,7 +3,6 @@ from pathlib import Path import env from rwx import ps -from rwx.log import stream as log from spcd.ci import project, projects from spcd.util import browse @@ -23,14 +22,6 @@ def spcd_build_project() -> None: pass -def spcd_list_environment() -> None: - for variable, value in sorted(projects.environment.items()): - if variable != "SPCD_SSH_KEY": - log.info(f"{variable} = {value}") - else: - log.info(f"{variable}") - - def spcd_synchronize() -> None: host = env.SPCD_PROJECT_PATH source = "out"