Skip to content

Commit 8b130b6

Browse files
Follow output coloring style of other actions
1 parent 9a4825d commit 8b130b6

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

src/Hook/Debug.php

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,25 +56,28 @@ protected function debugOutput(IO $io, Repository $repository): void
5656
} catch (Exception $e) {
5757
// ignore it, it just means there are no tags yet
5858
}
59-
60-
$io->write('<info>Debug Action</info>');
61-
$io->write($this->getArgumentOutput($originalHookArguments));
62-
$io->write(' Current git-tag: <comment>' . $currentGitTag . '</comment>');
63-
$io->write(' StandardInput: ' . PHP_EOL . ' ' . implode(PHP_EOL . ' ', $io->getStandardInput()));
59+
$io->write($this->getArgumentOutput($originalHookArguments), false);
60+
$io->write(' <comment>Current git-tag:</comment> ' . $currentGitTag);
61+
$io->write(
62+
' <comment>StandardInput:</comment> ' . PHP_EOL .
63+
' ' . implode(PHP_EOL . ' ', $io->getStandardInput())
64+
);
6465
}
6566

6667
/**
6768
* Format output to display original hook arguments
6869
*
70+
* Returns a string with a newline character at the end.
71+
*
6972
* @param array<string> $args
7073
* @return string
7174
*/
7275
protected function getArgumentOutput(array $args): string
7376
{
74-
$out = 'Original arguments:' . PHP_EOL;
77+
$out = ' <comment>Original arguments:</comment>' . PHP_EOL;
7578
foreach ($args as $name => $value) {
76-
$out .= ' ' . $name . ' => <comment>' . $value . '</comment>' . PHP_EOL;
79+
$out .= ' <comment>' . $name . '</comment> => ' . $value . PHP_EOL;
7780
}
78-
return ' ' . trim($out);
81+
return $out;
7982
}
8083
}

0 commit comments

Comments
 (0)