Skip to content

Commit 8482a69

Browse files
committed
safer
1 parent 15a0a9b commit 8482a69

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/Commands/MakeCommand.php

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,15 @@ public function boot(): void
2323

2424
public function whenStopping()
2525
{
26-
$this->input->write(Key::CTRL_C);
27-
$this->input->write(Key::CTRL_C);
28-
$this->input->write(Key::CTRL_C);
26+
$this->potentiallyExitOpenPrompts();
27+
$this->potentiallyExitOpenPrompts();
28+
$this->potentiallyExitOpenPrompts();
29+
}
30+
31+
protected function potentiallyExitOpenPrompts()
32+
{
33+
if (!$this->input->isClosed()) {
34+
$this->input->write(Key::CTRL_C);
35+
}
2936
}
3037
}

0 commit comments

Comments
 (0)