Edit docker-compose file of a service

This commit is contained in:
jpk 2023-01-10 15:19:16 +01:00
parent 9591395aa4
commit 3097807b05
1 changed files with 9 additions and 0 deletions

View File

@ -32,6 +32,14 @@ def complete_service_name(ctx, param, incomplete):
return [k for k in services.find_services(Path(config.root_directory)) if k.startswith(incomplete)]
@click.command()
@click.argument("service", nargs=1, shell_complete=complete_service_name)
@click.pass_context
def edit(ctx, service):
compose_file = services.get_compose_file(Path(ctx.obj["CONFIG"].root_directory) / service)
click.edit(filename=Path(compose_file))
@click.command()
@click.pass_context
@click.argument("service", nargs=1, shell_complete=complete_service_name)
@ -42,4 +50,5 @@ def control(ctx, service, command):
main.add_command(list)
main.add_command(edit)
main.add_command(control)