-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathTree.php
More file actions
42 lines (35 loc) · 1.09 KB
/
Tree.php
File metadata and controls
42 lines (35 loc) · 1.09 KB
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
39
40
41
42
<?php
declare(strict_types=1);
namespace Hypernode\Deploy\Command;
use Deployer\Deployer;
use Deployer\Command\TreeCommand;
use Symfony\Component\Console\Input\InputInterface as Input;
use Symfony\Component\Console\Output\OutputInterface as Output;
use Hypernode\Deploy\DeployRunner;
use Hypernode\Deploy\Exception\InvalidConfigurationException;
use Hypernode\Deploy\Exception\ValidationException;
class Tree extends TreeCommand
{
/**
* @var DeployRunner
*/
private $deployRunner;
public function __construct(
Deployer $deployer,
DeployRunner $deployRunner,
) {
parent::__construct($deployer);
$this->deployRunner = $deployRunner;
}
protected function execute(Input $input, Output $output): int
{
try {
$this->deployRunner->prepare(true, true, $input->getArgument('task'), false);
} catch (InvalidConfigurationException | ValidationException $e) {
$output->write($e->getMessage());
return 1;
}
$result = parent::execute($input, $output);
return $result;
}
}