Skip to content

Commit

Permalink
Remove install command
Browse files Browse the repository at this point in the history
  • Loading branch information
psrpinto committed Nov 7, 2017
1 parent 24ff8b0 commit e90ccc0
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 229 deletions.
92 changes: 0 additions & 92 deletions Command/InstallCommand.php

This file was deleted.

22 changes: 6 additions & 16 deletions Command/SetupCommand.php
Expand Up @@ -5,7 +5,6 @@
use Rj\FrontendBundle\Command\Options\SimpleOptionHelper;
use Rj\FrontendBundle\Command\Options\ChoiceOptionHelper;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
Expand Down Expand Up @@ -179,21 +178,12 @@ protected function execute(InputInterface $input, OutputInterface $output)
$this->createBowerJson($input, $output);

$output->writeln('');
$this->runInstallCommand($input, $output);
}

/**
* @param InputInterface $input
* @param OutputInterface $output
*/
private function runInstallCommand(InputInterface $input, OutputInterface $output)
{
if ($input->getOption('dry-run')) {
return $output->writeln('<info>Would have installed npm and bower dependencies</info>');
}

$this->getApplication()->find('rj_frontend:install')
->run(new ArrayInput(['command' => 'rj_frontend:install']), $output);
$output->writeln('<info>All files generated.</info>');
$output->writeln('');
$output->writeln('<comment>Make sure to install dependencies:</comment>');
$output->writeln('');
$output->writeln('<comment> npm install</comment>');
$output->writeln('');
}

/**
Expand Down
6 changes: 6 additions & 0 deletions Resources/doc/setup.rst
Expand Up @@ -111,6 +111,12 @@ You can read about all available options with:
Feel free to take a look at the generated ``gulpfile.js``. Even though the file is somewhat long, it should be straightforward to understand so you'll be able to adapt it to your use case, if need be.
Finally, install ``npm`` dependencies required by ``gulpfile.js``:

.. code-block :: shell
npm install
Livereload
----------

Expand Down
95 changes: 0 additions & 95 deletions Tests/Command/InstallCommandTest.php

This file was deleted.

26 changes: 0 additions & 26 deletions Tests/Command/SetupCommandTest.php
Expand Up @@ -2,8 +2,6 @@

namespace Rj\FrontendBundle\Tests\Command;

use PHPUnit_Framework_MockObject_MockObject;
use Rj\FrontendBundle\Command\InstallCommand;
use Rj\FrontendBundle\Command\SetupCommand;
use Symfony\Component\Console\Application;
use Symfony\Component\Console\Tester\CommandTester;
Expand Down Expand Up @@ -34,7 +32,6 @@ protected function setUp()

$application = new Application();

$application->add($this->getInstallCommand());
$application->add($command = new SetupCommand());

$this->command = $application->find($command->getName());
Expand Down Expand Up @@ -257,18 +254,6 @@ public function testCreateFiles()
$this->assertNotEmpty(file_get_contents("$base/bower.json"));
}

/**
* @runInSeparateProcess
*/
public function testInstallDependenciesDryRun()
{
$this->commandTester->execute([
'--dry-run' => true,
], ['interactive' => false]);

$this->assertRegExp('/Would have installed npm and bower dependencies/', $this->commandTester->getDisplay());
}

/**
* @param array $options
* @param array $expected
Expand Down Expand Up @@ -309,17 +294,6 @@ private function assertOptions(array $options, array $expected, $interactive = t
}
}

/**
* @return InstallCommand|PHPUnit_Framework_MockObject_MockObject
*/
private function getInstallCommand()
{
return $this->getMockBuilder('Rj\FrontendBundle\Command\InstallCommand')
->setMethods(['commandExists', 'runProcess'])
->getMock()
;
}

/**
* @param $input
*
Expand Down

0 comments on commit e90ccc0

Please sign in to comment.