<commit_before><?php

namespace Opifer\CmsBundle\Composer;

use Composer\Script\Event;

class ScriptHandler
{
    public static function installAssets(Event $event)
    {
        $event->getIO()->write('<info>Installing CmsBundle assets</info>');

        $currentDirectory = getcwd();

        $cmdDirectory = __DIR__.'/..';

        chdir($cmdDirectory);

        $command = 'bower install --allow-root';
        exec($command, $output, $status);

        if ($status) {
            throw new \RuntimeException("Running bower install failed with $status\n");
        }

        chdir($currentDirectory);
    }
}<commit_msg>Run Gulp during Composer's post-install<commit_after><?php

namespace Opifer\CmsBundle\Composer;

use Composer\Script\Event;

class ScriptHandler
{
    public static function installAssets(Event $event)
    {
        $event->getIO()->write('<info>Installing CmsBundle assets</info>');

        $currentDirectory = getcwd();

        $cmdDirectory = __DIR__.'/..';

        chdir($cmdDirectory);

        exec('bower install --allow-root', $output, $return_var);
        if ($return_var) {
            throw new \RuntimeException("Running bower install failed with $return_var\n");
        }

        exec('gulp default', $output, $return_var);
        if ($return_var) {
            throw new \RuntimeException("Running gulp failed with $return_var\n");
        }

        chdir($currentDirectory);
    }
}
{'fraction_non_alphanumeric': 0.13417190775681342, 'fraction_numerical': 0.0, 'mean_word_length': 2.74869109947644, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7046050', 'n_tokens_mistral': 421, 'n_tokens_neox': 408, 'n_words': 91}