Created
November 13, 2012 13:00
-
-
Save daFish/4065648 to your computer and use it in GitHub Desktop.
Run 'bower install' with composer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"scripts": { | |
"post-install-cmd": [ | |
// put this before installAssets | |
"Fmdb\\CoreBundle\\Composer\\ScriptHandler::installBowerAssets", | |
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets" | |
], | |
"post-update-cmd": [ | |
// put this before installAssets | |
"Fmdb\\CoreBundle\\Composer\\ScriptHandler::installBowerAssets", | |
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets" | |
] | |
}, | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace Fmdb\CoreBundle\Composer; | |
use Sensio\Bundle\DistributionBundle\Composer\ScriptHandler as BaseScriptHandler; | |
use Symfony\Component\ClassLoader\ClassCollectionLoader; | |
use Symfony\Component\Process\Process; | |
class ScriptHandler extends BaseScriptHandler | |
{ | |
public static function installBowerAssets($event) | |
{ | |
$process = new Process('bower install', null, null, null, 300); | |
$process->run(function ($type, $buffer) { echo $buffer; }); | |
if (!$process->isSuccessful()) { | |
throw new \RuntimeException(sprintf('An error occurred when executing the "%s" command.', escapeshellarg($cmd))); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment