From 400d4231d06b23d2ebb0666cb6011d22e5771bd0 Mon Sep 17 00:00:00 2001 From: Gentile G Date: Tue, 3 Oct 2023 13:24:50 +0200 Subject: [PATCH] Exit if return value diff than 0 --- main.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index e80a4c0..6500420 100644 --- a/main.py +++ b/main.py @@ -12,13 +12,17 @@ REPO_UPDATER_SCRIPT = os.getcwd() + '/update_repo.sh' def update_repositories(): for repo_path in config.git_repositories: - os.system(f"{REPO_UPDATER_SCRIPT} {repo_path}") + ret = os.system(f"{REPO_UPDATER_SCRIPT} {repo_path}") + if ret > 0: + exit(ret) def update_stack(stack): project_name = stack['Name'] compose_file = DOCKER_COMPOSE_PATH.format(stack['Id']) - os.system(f"{BASH_COMPANION_SCRIPT} {project_name} {compose_file}") + ret = os.system(f"{BASH_COMPANION_SCRIPT} {project_name} {compose_file}") + if ret > 0: + exit(ret) if __name__ == '__main__':