• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

LibreSign / libresign / 4398176677

pending completion
4398176677

Pull #1502

github

GitHub
Merge f5a447164 into a5e7e7db8
Pull Request #1502: Log CLI exceptions

3 of 45 new or added lines in 5 files covered. (6.67%)

4 existing lines in 3 files now uncovered.

2583 of 4488 relevant lines covered (57.55%)

4.72 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/lib/Command/Install.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace OCA\Libresign\Command;
6

7
use OCA\Libresign\Service\InstallService;
8
use Psr\Log\LoggerInterface;
9
use Symfony\Component\Console\Input\InputInterface;
10
use Symfony\Component\Console\Input\InputOption;
11
use Symfony\Component\Console\Output\OutputInterface;
12

13
class Install extends Base {
14
        public function __construct(
15
                InstallService $installService,
16
                LoggerInterface $logger
17
        ) {
18
                parent::__construct(
×
NEW
19
                        $installService,
×
NEW
20
                        $logger
×
UNCOV
21
                );
×
22
        }
23

24
        protected function configure(): void {
25
                $this
×
26
                        ->setName('libresign:install')
×
27
                        ->setDescription('Install files')
×
28
                        ->addOption('all',
×
29
                                null,
×
30
                                InputOption::VALUE_NONE,
×
31
                                'All binaries'
×
32
                        )
×
33
                        ->addOption('jsignpdf',
×
34
                                null,
×
35
                                InputOption::VALUE_NONE,
×
36
                                'JSignPdf'
×
37
                        )
×
38
                        ->addOption('cfssl',
×
39
                                null,
×
40
                                InputOption::VALUE_NONE,
×
41
                                'CFSSL'
×
42
                        )
×
43
                        ->addOption('cli',
×
44
                                null,
×
45
                                InputOption::VALUE_NONE,
×
46
                                'LibreSign CLI'
×
47
                        )
×
48
                        ->addOption('java',
×
49
                                null,
×
50
                                InputOption::VALUE_NONE,
×
51
                                'Java'
×
52
                        );
×
53
        }
54

55
        protected function execute(InputInterface $input, OutputInterface $output): int {
56
                $ok = false;
×
57
                $this->installService->setOutput($output);
×
58

59
                try {
NEW
60
                        $all = $input->getOption('all');
×
NEW
61
                        if ($input->getOption('java') || $all) {
×
NEW
62
                                $this->installService->installJava();
×
NEW
63
                                $ok = true;
×
64
                        }
NEW
65
                        if ($input->getOption('jsignpdf') || $all) {
×
NEW
66
                                $this->installService->installJSignPdf();
×
NEW
67
                                $ok = true;
×
68
                        }
NEW
69
                        if ($input->getOption('cfssl') || $all) {
×
NEW
70
                                $this->installService->installCfssl();
×
NEW
71
                                $ok = true;
×
72
                        }
NEW
73
                        if ($input->getOption('cli') || $all) {
×
NEW
74
                                $this->installService->installCli();
×
NEW
75
                                $ok = true;
×
76
                        }
NEW
77
                } catch (\Exception $e) {
×
NEW
78
                        $this->logger->error($e->getMessage());
×
NEW
79
                        throw $e;
×
80
                }
81

82
                if (!$ok) {
×
83
                        $output->writeln('<error>Please inform what you want to install</error>');
×
84
                        $output->writeln('<error>--all to all</error>');
×
85
                        $output->writeln('<error>--help to check the available options</error>');
×
NEW
86
                        return 1;
×
87
                }
88

UNCOV
89
                return 0;
×
90
        }
91
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc