Skip to content

Commit dc5e474

Browse files
author
Alan Christie
committed
fix: COMPOSE_COMMAND now set during initialisation
1 parent 2b2db32 commit dc5e474

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/jote/compose.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,15 @@ def __init__(
158158
self._user_id: Optional[int] = user_id
159159
self._group_id: Optional[int] = group_id
160160

161+
# Do we have the 'docker compose' command?
162+
if not Compose._COMPOSE_COMMAND:
163+
Compose._COMPOSE_COMMAND = _get_docker_compose_command()
164+
print(f"# Compose command: {Compose._COMPOSE_COMMAND}")
165+
# Do we have the 'docker-compose' command?
166+
if not Compose._COMPOSE_VERSION:
167+
Compose._COMPOSE_VERSION = _get_docker_compose_version()
168+
print(f"# Compose version: {Compose._COMPOSE_VERSION}")
169+
161170
def get_test_path(self) -> str:
162171
"""Returns the path to the root directory for a given test."""
163172
root: str = get_test_root()
@@ -181,15 +190,6 @@ def create(self) -> str:
181190
if os.path.exists(test_path):
182191
shutil.rmtree(test_path)
183192

184-
# Do we have the command?
185-
if not Compose._COMPOSE_COMMAND:
186-
Compose._COMPOSE_COMMAND = _get_docker_compose_command()
187-
print(f"# Compose command: {Compose._COMPOSE_COMMAND}")
188-
# Do we have the docker-compose version the user's installed?
189-
if not Compose._COMPOSE_VERSION:
190-
Compose._COMPOSE_VERSION = _get_docker_compose_version()
191-
print(f"# Compose version: {Compose._COMPOSE_VERSION}")
192-
193193
# Make the test directory
194194
# (where the test is launched from)
195195
# and the project directory (a /project sud-directory of test)

0 commit comments

Comments
 (0)