Skip to content

Commit d6472a9

Browse files
Don't fail if there are no tags yet
1 parent ff6b55a commit d6472a9

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

src/Hook/Debug.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use CaptainHook\App\Config;
1515
use CaptainHook\App\Console\IO;
1616
use CaptainHook\App\Exception\ActionFailed;
17+
use Exception;
1718
use SebastianFeldmann\Git\Repository;
1819

1920
/**
@@ -48,7 +49,13 @@ abstract public function execute(Config $config, IO $io, Repository $repository,
4849
protected function debugOutput(IO $io, Repository $repository): void
4950
{
5051
$originalHookArguments = $io->getArguments();
51-
$currentGitTag = $repository->getInfoOperator()->getCurrentTag();
52+
53+
$currentGitTag = 'no tags yet';
54+
try {
55+
$currentGitTag = $repository->getInfoOperator()->getCurrentTag();
56+
} catch (Exception $e) {
57+
// ignore it, it just means there are no tags yet
58+
}
5259

5360
$io->write(['', '']);
5461
$io->write('<info>Executing Dummy action</info>');

0 commit comments

Comments
 (0)