mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-10 19:43:16 +00:00
Refactor command line utilities
This commit is contained in:
@@ -12,7 +12,6 @@
|
||||
namespace Alchemy\Phrasea\Command\Developer;
|
||||
|
||||
use Alchemy\Phrasea\Command\Command;
|
||||
use Alchemy\Phrasea\Exception\RuntimeException;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
|
||||
@@ -33,34 +32,13 @@ class LessCompiler extends Command
|
||||
*/
|
||||
protected function doExecute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
$copies = array(
|
||||
$this->container['root.path'] . '/www/assets/bootstrap/img/glyphicons-halflings-white.png' => $this->container['root.path'] . '/www/skins/build/bootstrap/img/glyphicons-halflings-white.png',
|
||||
$this->container['root.path'] . '/www/assets/bootstrap/img/glyphicons-halflings.png' => $this->container['root.path'] . '/www/skins/build/bootstrap/img/glyphicons-halflings.png',
|
||||
);
|
||||
|
||||
foreach ($copies as $source => $target) {
|
||||
foreach ($this->container['phraseanet.less-assets'] as $source => $target) {
|
||||
$this->container['filesystem']->mkdir(dirname($target));
|
||||
$this->container['filesystem']->copy($source, $target);
|
||||
}
|
||||
|
||||
$files = array(
|
||||
$this->container['root.path'] . '/www/skins/login/less/login.less' => $this->container['root.path'] . '/www/skins/build/login.css',
|
||||
$this->container['root.path'] . '/www/skins/account/account.less' => $this->container['root.path'] . '/www/skins/build/account.css',
|
||||
$this->container['root.path'] . '/www/assets/bootstrap/less/bootstrap.less' => $this->container['root.path'] . '/www/skins/build/bootstrap/css/bootstrap.css',
|
||||
$this->container['root.path'] . '/www/assets/bootstrap/less/responsive.less' => $this->container['root.path'] . '/www/skins/build/bootstrap/css/bootstrap-responsive.css',
|
||||
);
|
||||
|
||||
$output->writeln('Building Assets...');
|
||||
|
||||
try {
|
||||
$this->container['phraseanet.less-builder']->build($files);
|
||||
} catch (RuntimeException $e) {
|
||||
$output->writeln(sprintf('<error>Could not build less files %s</error>', $e->getMessage()));
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
$output->writeln('<info>Build done !</info>');
|
||||
$output->writeln('Building LESS assets');
|
||||
$this->container['phraseanet.less-builder']->build($this->container['phraseanet.less-mapping'], $output);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user