Skip to content

Commit

Permalink
bundle command
Browse files Browse the repository at this point in the history
  • Loading branch information
xrow committed Feb 8, 2017
1 parent 2a353dd commit 3a06830
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
8 changes: 3 additions & 5 deletions Command/BundleGeneratorCommand.php
Expand Up @@ -44,7 +44,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
$namespace = 'Xrow\\' . $name . "Bundle";
$projectRootDirectory = $this->getContainer()->getParameter('kernel.root_dir').'/..';

$dir = $projectRootDirectory."/src";
$dir = $projectRootDirectory."/vendor";

$bundle = new Bundle(
$namespace,
Expand Down Expand Up @@ -93,10 +93,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
$fs = new Filesystem();
$fs->remove($bundle->getTargetDirectory());

#$output->writeln( 'Composer run' );
#$process = new Process("composer update" , $projectRootDirectory );
#$process->run();
$output->writeln( $name . ' created');
$output->writeln( $name . ' created in ' . $bundle->getTargetDirectory() );
$output->writeln( 'Run: composer require ' . $name . ' dev-master' );
}
protected function updateKernel(OutputInterface $output, KernelInterface $kernel, Bundle $bundle)
{
Expand Down
2 changes: 1 addition & 1 deletion Model/Bundle.php
Expand Up @@ -36,6 +36,6 @@ public function __construct($namespace, $name, $targetDirectory, $configurationF
*/
public function getTargetDirectory()
{
return rtrim($this->targetDirectory, '/').'/'.trim( strtolower(strtr($this->namespace, '\\', '/') ), '/');
return rtrim($this->targetDirectory, '/').'/'.trim( strtolower(strtr(str_replace("Bundle", "-bundle", $this->namespace ), '\\', '/') ), '/');
}
}

0 comments on commit 3a06830

Please sign in to comment.