-
Notifications
You must be signed in to change notification settings - Fork 10
/
php-commitizen
24 lines (20 loc) · 783 Bytes
/
php-commitizen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/env php
<?php
declare(strict_types=1);
use Damianopetrungaro\PHPCommitizen\CreateConventionalCommit;
use Symfony\Component\Console\Application;
use Symfony\Component\Console\Output\ConsoleOutput;
foreach ([__DIR__ . '/../../autoload.php', __DIR__ . '/../vendor/autoload.php', __DIR__ . '/vendor/autoload.php'] as $autoloadFile) {
if (file_exists($autoloadFile)) {
require $autoloadFile;
break;
}
}
try {
$configuration = require __DIR__ . '/.php-commitizen.php';
$app = new Application('PHP Commitizen');
$app->add(new \Damianopetrungaro\PHPCommitizen\CommitCommand($configuration, new CreateConventionalCommit()));
$app->run();
} catch (Throwable $e) {
(new ConsoleOutput())->writeln("<error>{$e->getMessage()}</error>");
}