Skip to content

Commit 245c6bc

Browse files
committed
allows container id to be passed to start and stop
1 parent 74f8d26 commit 245c6bc

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

app/Commands/StartCommand.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ public function startableContainers(): Collection
6464
public function startByServiceNameOrContainerId(string $service, Collection $startableContainers): void
6565
{
6666
$containersByServiceName = $startableContainers
67-
->filter(function ($serviceName) use ($service) {
68-
return Str::startsWith($serviceName, $service);
67+
->filter(function ($serviceName, $key) use ($service) {
68+
return Str::startsWith($serviceName, $service) || $key === $service;
6969
});
7070

7171
// If we don't get any container by the service name, that probably means

app/Commands/StopCommand.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ private function stoppableContainers(): Collection
6565
private function stopByServiceNameOrContainerId(string $service, Collection $stoppableContainers): void
6666
{
6767
$containersByServiceName = $stoppableContainers
68-
->filter(function ($containerName) use ($service) {
69-
return Str::startsWith($containerName, $service);
68+
->filter(function ($containerName, $key) use ($service) {
69+
return Str::startsWith($containerName, $service) || $key === $service;
7070
});
7171

7272
if ($containersByServiceName->isEmpty()) {

0 commit comments

Comments
 (0)