protected function execute(InputInterface $input, OutputInterface $output)
{
$fs = new Filesystem();
if ($fs->exists(self::ENV_FILE)) {
$output->writeln(self::ENV_FILE . ' already exist!');
return;
}
$helper = $this->getHelper('question');
$data = [];
$awsAccessKeyIdQuestion = new Question('Please enter your AWS_ACCESS_KEY_ID: ');
$data['AWS_ACCESS_KEY_ID'] = $helper->ask($input, $output, $awsAccessKeyIdQuestion);
$awsSecretAccessKeyIdQuestion = new Question('Please enter your AWS_SECRET_ACCESS_KEY: ');
$data['AWS_SECRET_ACCESS_KEY'] = $helper->ask($input, $output, $awsSecretAccessKeyIdQuestion);
$regionQuestion = new Question('Please enter the name of your region [eu-west-1]: ', 'eu-west-1');
$data['AWS_DEFAULT_REGION'] = $helper->ask($input, $output, $regionQuestion);
try {
$fs->dumpFile(self::ENV_FILE, $this->parseContent($data));
$output->writeln('');
$output->writeln(self::ENV_FILE . ' file was successfully created.');
$output->writeln('You should also add it to your .gitignore with:');
$output->writeln('echo .env.default >> .gitignore');
} catch (IOExceptionInterface $e) {
echo 'An error occurred while creating ' . self::ENV_FILE . ' file at ' . $e->getPath();
}
}