From b7a01f3908e6ab3adef666ae7278e1106449e382 Mon Sep 17 00:00:00 2001 From: "ityaozm@gmail.com" Date: Wed, 3 Jan 2024 15:27:53 +0800 Subject: [PATCH] fix(commands): Fix formatting issue in CommitCommand - Fix formatting issue in the CommitCommand file - Transform body lines to start with a hyphen - Set process timeout to null - Set process to must run --- app/Commands/CommitCommand.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/Commands/CommitCommand.php b/app/Commands/CommitCommand.php index 94b34f9..72bf69d 100644 --- a/app/Commands/CommitCommand.php +++ b/app/Commands/CommitCommand.php @@ -99,14 +99,15 @@ function ($attempts) use ($cachedDiff): string { ); }, 'generating...'.PHP_EOL); - $this->task(str_repeat(PHP_EOL, 2).'2. Confirming commit message', function () use (&$message): void { + $this->task(PHP_EOL.'2. Confirming commit message', function () use (&$message): void { $message = collect(json_decode($message, true, 512, JSON_THROW_ON_ERROR)) ->pipe(static function (Collection $message): Collection { if (\is_array($message['body'])) { $message['body'] = collect($message['body']) ->transform(static function (string $line): string { return Str::start(trim($line, " \t\n\r\x0B"), '- '); - })->implode(PHP_EOL); + }) + ->implode(PHP_EOL); } return $message; @@ -125,10 +126,10 @@ function ($attempts) use ($cachedDiff): string { }); }, 'confirming...'.PHP_EOL); - $this->task(str_repeat(PHP_EOL, 2).'3. Committing message', function () use ($message): void { + $this->task(PHP_EOL.'3. Committing message', function () use ($message): void { tap($this->createProcess($this->getCommitCommand($message)), function (Process $process): void { $this->shouldEdit() and $process->setTty(true); - })->setTimeout(null)->run(); + })->setTimeout(null)->mustRun(); }, 'committing...'.PHP_EOL); $this->output->success('Successfully generated and committed message.');