summaryrefslogtreecommitdiff
path: root/src/Command/RunCommand.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/Command/RunCommand.php')
-rw-r--r--src/Command/RunCommand.php13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/Command/RunCommand.php b/src/Command/RunCommand.php
index cc9c7fd..e76c063 100644
--- a/src/Command/RunCommand.php
+++ b/src/Command/RunCommand.php
@@ -5,6 +5,7 @@ namespace PHPIAC\Command;
use PHPIAC\Connection;
use PHPIAC\Task;
use Symfony\Component\Console\Command\Command;
+use Symfony\Component\Console\Helper\FormatterHelper;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
@@ -28,21 +29,25 @@ class RunCommand extends Command
{
$config = include $input->getOption('config');
- Connection::getInstance($config['host'], $config['user'], $config['private_key_file']);
+ Connection::initialize($config['host'], $config['user'], $config['private_key_file']);
+
+ /**@var FormatterHelper $formater*/
+ $formater = $this->getHelper('formatter');
foreach ($config['tasks'] as $task) {
/**@var Task $task*/
+ $output->writeln($task->getName());
if (! $task->module->checkState()) {
- $output->writeln($task->getName());
$output->writeln('Running');
- $task->module->getCommands();
+ $task->module->execute();
}
else {
- $output->writeln($task->getName());
$output->writeln('Skipping');
}
+
+ $output->writeln('- - -');
}
return Command::SUCCESS;