-
-
Save flug/d94f6535778506159cd1 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 hidden or 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