From 67d0f91a5b5ebeca4333fcc1832713d4fbc1d35d Mon Sep 17 00:00:00 2001 From: jpk Date: Fri, 13 Jan 2023 15:43:30 +0100 Subject: [PATCH] Improved code readability --- doxy/__init__.py | 2 +- doxy/cli.py | 20 +++++++------------- pyproject.toml | 2 +- 3 files changed, 9 insertions(+), 15 deletions(-) diff --git a/doxy/__init__.py b/doxy/__init__.py index 6a9beea..3d26edf 100644 --- a/doxy/__init__.py +++ b/doxy/__init__.py @@ -1 +1 @@ -__version__ = "0.4.0" +__version__ = "0.4.1" diff --git a/doxy/cli.py b/doxy/cli.py index 8cebdb3..efcacf7 100644 --- a/doxy/cli.py +++ b/doxy/cli.py @@ -83,19 +83,13 @@ def update(ctx, service, remove): Path(ctx.obj["CONFIG"].root_directory) / service ) print(Rule(f"Updating {service}")) - services.docker_compose_command( - [ - ["stop", "down"][remove], - ], - compose_file, - ) - services.docker_compose_command( - [ - "pull", - ], - compose_file, - ) - services.docker_compose_command(["up", "-d"], compose_file) + command_chain = [ + ["down" if remove else "stop"], + ["pull"], + ["up", "-d"], + ] + for command in command_chain: + services.docker_compose_command(command, compose_file) main.add_command(list) diff --git a/pyproject.toml b/pyproject.toml index 42b06bc..419adb7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "doxy" -version = "0.4.0" +version = "0.4.1" description = "" authors = ["jpk "] readme = "README.md"