<commit_before><?php

namespace DeltaCli\Script;

use DeltaCli\Project;
use DeltaCli\Script;
use Exception;

class InstallFsevents extends Script
{
    public function __construct(Project $project)
    {
        parent::__construct(
            $project,
            'install-fsevents',
            'Install the fsevents PECL extension on OS X.'
        );
    }

    protected function addSteps()
    {

        $this
            ->addStep(
                'ensure-root',
                function () {
                    if ('root' !== trim(shell_exec('whoami'))) {
                        throw new Exception('install-fsevents must be run as root.');
                    }
                }
            )
            ->addStep(
                'ensure-osx',
                function () {
                    if ('Darwin' !== php_uname('s')) {
                        throw new Exception('fsevents PECL extension can only be installed on OS X.');
                    }
                }
            )
            ->addStep(
                'check-for-phpize',
                function () {
                    if (!file_exists('/usr/bin/phpize') || !is_executable('/usr/bin/phpize')) {
                        throw new Exception(
                            'phpize is required to build fsevents.  Run xcode-select --install to install it.'
                        );
                    }
                }<commit_msg>Always run xcode-select when installing fsevents<commit_after><?php

namespace DeltaCli\Script;

use DeltaCli\Project;
use DeltaCli\Script;
use Exception;

class InstallFsevents extends Script
{
    public function __construct(Project $project)
    {
        parent::__construct(
            $project,
            'install-fsevents',
            'Install the fsevents PECL extension on OS X.'
        );
    }

    protected function addSteps()
    {

        $this
            ->addStep(
                'ensure-root',
                function () {
                    if ('root' !== trim(shell_exec('whoami'))) {
                        throw new Exception('install-fsevents must be run as root.');
                    }
                }
            )
            ->addStep(
                'ensure-osx',
                function () {
                    if ('Darwin' !== php_uname('s')) {
                        throw new Exception('fsevents PECL extension can only be installed on OS X.');
                    }
                }
            )
            ->addStep(
                'check-for-phpize',
                function () {
                    exec('xcode-select --install');
                }
{'fraction_non_alphanumeric': 0.10152091254752851, 'fraction_numerical': 0.0, 'mean_word_length': 1.1530278232405893, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '6428717', 'n_tokens_mistral': 689, 'n_tokens_neox': 630, 'n_words': 159}