-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.php
executable file
·38 lines (33 loc) · 918 Bytes
/
main.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/env php
<?php
declare(strict_types=1);
require __DIR__ . '/vendor/autoload.php';
use PounceTech\CommandProcess;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\SingleCommandApplication;
/**
* @return string[]
*/
function getBuildInfo(): array
{
return [
'name' => '@app_name@',
'description' => '@app_description@',
'version' => '@git_version@'
];
}
$metadata = getBuildInfo();
try {
$retCode = (new SingleCommandApplication())
->setName($metadata['name'])
->setDescription($metadata['description'])
->setVersion($metadata['version'])
->setCode(
fn(InputInterface $input, OutputInterface $output) => (new CommandProcess($input, $output))->process()
)
->run();
} catch (\Exception) {
return 1;
}
return $retCode;