Skip to content

Commit

Permalink
validate aws config on fire not in constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
fobilow committed Feb 22, 2015
1 parent 91e4b1b commit f5d4092
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions app/Cme/Cli/SesTool.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,19 @@ class SesTool extends CmeDbCommand
public function __construct()
{
parent::__construct();
}

private function _validateAws()
{
$key = Config::get('cme.aws_key');
$secret = Config::get('cme.aws_secret');
$region = Config::get('cme.aws_region');

if(!$key || !$secret || !$region)
{
echo(
"You need to set the following keys in your .env file\n"
. " \n - aws_key, \n - aws_secret \n - aws_region"
." \n\nYou can get this from your AWS console online"
." \n\nYou can get this from your AWS console online"
);
die;
}
Expand All @@ -66,6 +68,7 @@ public function __construct()
*/
public function fire()
{
$this->_validateAws();
$task = $this->argument('task');
switch($task)
{
Expand Down

0 comments on commit f5d4092

Please sign in to comment.