<commit_before><?php

namespace Deployer;

task('deploy:composer_install_check', function () {
    exec('composer install --dry-run 2>&1 ', $output);
    $outputInline = join(' ', $output);
    if (strpos($outputInline, 'Nothing to install or update') === false) {
        throw new \RuntimeException('Please run composer install command');
    }
})->desc('Check composer install output');<commit_msg>[TASK] Refactor "composer install" checj.<commit_after><?php

namespace Deployer;

task('deploy:composer_install_check', function () {
    $composerBin = runLocally('which composer')->toString();
    if (runLocally("if hash $composerBin 2>/dev/null; then echo 'true'; fi")->toBool()) {
        $output = runLocally($composerBin . ' install --dry-run 2>&1');
        if (strpos($output, 'Nothing to install or update') === false) {
            throw new \RuntimeException('A composer.lock changes has been detected but you did not run "composer install". Please run composer install, then check if everything is working on your instance and do deploy after.');
        }
    }
})->desc('Check if composer install is needed.');
{'fraction_non_alphanumeric': 0.1438721136767318, 'fraction_numerical': 0.004440497335701598, 'mean_word_length': 4.169724770642202, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 10, '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': '1884957', 'n_tokens_mistral': 317, 'n_tokens_neox': 313, 'n_words': 103}