[Nostromo] Refactor config load

This commit is contained in:
Andrés Montañez
2017-01-29 19:25:03 -03:00
parent 91da979151
commit 0bae8e2b1b
18 changed files with 24 additions and 53 deletions
+8
View File
@@ -66,4 +66,12 @@ abstract class AbstractCommand extends Command
$utils = new Utils();
return $utils->getStageName($this->runtime->getStage());
}
/**
* Requires the configuration to be loaded
*/
protected function requireConfig()
{
$this->getApplication()->configure();
}
}
@@ -41,6 +41,8 @@ class DumpCommand extends AbstractCommand
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
$this->requireConfig();
$output->writeln('Starting <fg=blue>Magallanes</>');
$output->writeln('');
@@ -42,6 +42,8 @@ class EnvironmentsCommand extends AbstractCommand
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
$this->requireConfig();
$output->writeln('Starting <fg=blue>Magallanes</>');
$output->writeln('');
+2
View File
@@ -58,6 +58,8 @@ class DeployCommand extends AbstractCommand
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
$this->requireConfig();
$output->writeln('Starting <fg=blue>Magallanes</>');
$output->writeln('');
@@ -51,6 +51,8 @@ class ListCommand extends AbstractCommand
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
$this->requireConfig();
$utils = new Utils();
$output->writeln('Starting <fg=blue>Magallanes</>');
$output->writeln('');
@@ -52,6 +52,8 @@ class RollbackCommand extends DeployCommand
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
$this->requireConfig();
$output->writeln('Starting <fg=blue>Magallanes</>');
$output->writeln('');