diff --git a/cd.sh b/cd.sh index 8ac72bf..dbbfd8f 100644 --- a/cd.sh +++ b/cd.sh @@ -250,7 +250,7 @@ local root function cd_bootstrap { cd_step "${FUNCNAME}" - "${CD_PYTHON_COMMAND}" -m "${CD_NAME}" "${CD_ENV}" + "${CD_PYTHON_COMMAND}" -m "${CD_NAME}" } function cd_main { diff --git a/cd/__init__.py b/cd/__init__.py index 0849737..7dbddbd 100644 --- a/cd/__init__.py +++ b/cd/__init__.py @@ -1,22 +1,28 @@ import os +from cd.project import Project +from cd.projects import Projects from rwx import ps COMMANDS_PREFIX = 'cd-' +environment = sorted(os.environ.items()) +project = Project() +projects = Projects(environment) + def cd_clone_branch(): ps.run('git', 'clone', - '--branch', os.environ['CD_PROJECT_BRANCH'], + '--branch', project.branch, '--', - os.environ['CD_PROJECT_URL'], + project.url, '.', ) def cd_list_environment(): - for variable, value in sorted(os.environ.items()): + for variable, value in environment: print(variable, '=', value) diff --git a/cd/project.py b/cd/project.py new file mode 100644 index 0000000..8ee7c56 --- /dev/null +++ b/cd/project.py @@ -0,0 +1,3 @@ +class Project: + def __init__(self): + pass diff --git a/cd/projects.py b/cd/projects.py new file mode 100644 index 0000000..96f57bf --- /dev/null +++ b/cd/projects.py @@ -0,0 +1,3 @@ +class Projects: + def __init__(self, environment): + self.env = environment