fixes
Some checks failed
/ job (push) Failing after 7s

This commit is contained in:
Marc Beninca 2024-04-27 17:09:51 +02:00
parent 5bbcb10091
commit fedeec960d
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F
3 changed files with 12 additions and 9 deletions

View file

@ -6,9 +6,8 @@ from rwx import ps
COMMANDS_PREFIX = 'cd-' COMMANDS_PREFIX = 'cd-'
environment = os.environ projects = Projects(os.environ)
project = Project(environment) project = Project(projects)
projects = Projects(environment)
def cd_clone_branch(): def cd_clone_branch():
@ -22,7 +21,7 @@ def cd_clone_branch():
def cd_list_environment(): def cd_list_environment():
for variable, value in sorted(environment.items()): for variable, value in sorted(os.environ.items()):
print(variable, '=', value) print(variable, '=', value)

View file

@ -11,12 +11,15 @@ NAME = [
class Project: class Project:
def __init__(self, environment): def __init__(self, projects):
self.projects = projects
# branch # branch
for variable in BRANCH: for variable in BRANCH:
if value := environment.get(variable, None): if value := projects.environment.get(variable, None):
self.branch = value self.branch = value
# name # name
for variable in NAME: for variable in NAME:
if value := environment.get(variable, None): if value := projects.environment.get(variable, None):
self.name = path.basename(value) self.name = path.basename(value)
# url
self.url = path.join(projects.url, self.name)

View file

@ -12,11 +12,12 @@ SERVER_URL = [
class Projects: class Projects:
def __init__(self, environment): def __init__(self, environment):
self.environment = environment
# group, name # group, name
for variable in GROUP_AND_NAME: for variable in GROUP_AND_NAME:
if value := environment.get(variable, None): if value := self.environment.get(variable, None):
self.group, self.name = path.split(value) self.group, self.name = path.split(value)
# url # url
for variable in SERVER_URL: for variable in SERVER_URL:
if value := environment.get(variable, None): if value := self.environment.get(variable, None):
self.url = path.join(value, self.group) self.url = path.join(value, self.group)