Skip to content

Commit

Permalink
fix: handle comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Danyal-Faheem committed Dec 6, 2024
1 parent 49100df commit f4ec484
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
- [Bugfix] Fix breakpoint debugging by attaching container stdin when running tutor dev start <service> for a single <service>. (by @Danyal-Faheem)
- [Bugfix] Fix breakpoint debugging by attaching container stdin when running tutor dev start <service> for a single service. (by @Danyal-Faheem)
10 changes: 6 additions & 4 deletions tutor/commands/compose.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,24 +245,26 @@ def start(
services: list[str],
) -> None:
command = ["up", "--remove-orphans"]
attach = len(services) == 1
attach = len(services) == 1 and not detach
if build:
command.append("--build")
# We have to run the container in detached mode first to attach to it
if detach or attach:
command.append("-d")

else:
fmt.echo_info("ℹ️ To exit logs without stopping the containers, use ctrl+z")

# Start services
config = tutor_config.load(context.root)
context.job_runner(config).docker_compose(*command, *services)
if attach and not detach:

if attach:
fmt.echo_info(
f"""Attaching to service {services[0]}
ℹ️ To detach without stopping the service, use ctrl+p followed by ctrl+q"""
)
context.job_runner(config).docker_compose("attach", *services)


@click.command(help="Stop a running platform")
@click.argument("services", metavar="service", nargs=-1)
@click.pass_obj
Expand Down

0 comments on commit f4ec484

Please sign in to comment.