mirror of
https://github.com/bdnugget/n98-magerun2.git
synced 2026-11-07 08:57:30 +00:00
36 lines
994 B
PHP
36 lines
994 B
PHP
<?php
|
|
|
|
namespace N98\Magento\Command\Developer\Module\Create\SubCommand;
|
|
|
|
use N98\Magento\Command\SubCommand\AbstractSubCommand;
|
|
|
|
class CreateReadmeFile extends AbstractSubCommand
|
|
{
|
|
/**
|
|
* @see https://raw.github.com/sprankhub/Magento-Extension-Sample-Readme/master/readme.markdown
|
|
*
|
|
* @return bool
|
|
*/
|
|
public function execute()
|
|
{
|
|
if ($this->config->getBool('isModmanMode')) {
|
|
$outFile = $this->config->getString('modmanRootFolder') . '/readme.md';
|
|
} else {
|
|
$outFile = $this->config->getString('moduleDirectory') . '/readme.md';
|
|
}
|
|
|
|
|
|
\file_put_contents(
|
|
$outFile,
|
|
$this->getCommand()->getHelper('twig')->render(
|
|
'dev/module/create/app/code/module/readme.md.twig',
|
|
$this->config->getArray('twigVars')
|
|
)
|
|
);
|
|
|
|
$this->output->writeln('<info>Created file: <comment>' . $outFile .'<comment></info>');
|
|
|
|
return true;
|
|
}
|
|
}
|