This commit is contained in:
parent
ee69c088c2
commit
e99ced2a20
3 changed files with 15 additions and 8 deletions
10
spcd.sh
10
spcd.sh
|
@ -45,9 +45,13 @@ spcd_main() {
|
|||
spcd_list_environment_variables() {
|
||||
spcd_step "List environment variables"
|
||||
for spcd_lev__name in $(printenv | cut -d = -f 1 | sort); do
|
||||
spcd_lev__text=""
|
||||
eval "spcd_lev__text=\"\${${spcd_lev__name}}\""
|
||||
echo "${spcd_lev__name}=${spcd_lev__text}"
|
||||
if [ "${spcd_lev__name}" != "SPCD_SSH_KEY" ]; then
|
||||
spcd_lev__text=
|
||||
eval "spcd_lev__text=\"\${${spcd_lev__name}}\""
|
||||
echo "${spcd_lev__name}=${spcd_lev__text}"
|
||||
else
|
||||
echo "${spcd_lev__name}"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
|
|
|
@ -44,7 +44,6 @@ def install_commands(path: str) -> None:
|
|||
for command in [
|
||||
"browse-workspace",
|
||||
"build-project",
|
||||
"clone-branch",
|
||||
"list-environment",
|
||||
"synchronize",
|
||||
]:
|
||||
|
@ -57,17 +56,18 @@ def main(main: str) -> None:
|
|||
name = Path(path).name
|
||||
if name == "__main__.py":
|
||||
clone_project_branch()
|
||||
set_ssh(*arguments)
|
||||
set_ssh()
|
||||
install_commands(main)
|
||||
else:
|
||||
function = getattr(cmd, name.replace("-", "_"))
|
||||
function(*arguments)
|
||||
|
||||
|
||||
def set_ssh(*arguments: list[str]) -> None:
|
||||
def set_ssh() -> None:
|
||||
step("Set SSH")
|
||||
# get variables
|
||||
ssh_key, ssh_hosts = arguments
|
||||
ssh_hosts = projects.environment.get("SPCD_SSH_HOSTS")
|
||||
ssh_key = projects.environment.get("SPCD_SSH_KEY")
|
||||
# set key type
|
||||
ssh_type = "ed25519"
|
||||
# set home directory
|
||||
|
|
|
@ -25,7 +25,10 @@ def spcd_build_project() -> None:
|
|||
|
||||
def spcd_list_environment() -> None:
|
||||
for variable, value in sorted(projects.environment.items()):
|
||||
log.info(f"{variable} = {value}")
|
||||
if variable != "SPCD_SSH_KEY":
|
||||
log.info(f"{variable} = {value}")
|
||||
else:
|
||||
log.info(f"{variable}")
|
||||
|
||||
|
||||
def spcd_synchronize() -> None:
|
||||
|
|
Loading…
Reference in a new issue