<commit_before><?php

namespace Laravel\Dusk\Console;

use Illuminate\Console\Command;

class InstallCommand extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'dusk:install';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Install Dusk into the application';

    /**
     * Create a new command instance.
     *
     * @return void
     */
    public function __construct()
    {
        parent::__construct();
    }

    /**
     * Execute the console command.
     *
     * @return mixed
     */
    public function handle()
    {
        if (! is_dir(base_path('tests/Browser/Pages'))) {
            mkdir(base_path('tests/Browser/Pages'), 0755, true);
        }

        if (! is_dir(base_path('tests/Browser/screenshots'))) {
            mkdir(base_path('tests/Browser/screenshots'), 0755, true);
        }

        if (! is_dir(base_path('tests/Browser/console'))) {
            mkdir(base_path('tests/Browser/console'), 0755, true);
        }

        copy(__DIR__.'/../../stubs/ExampleTest.stub', base_path('tests/Browser/ExampleTest.php'));
        copy(__DIR__.'/../../stubs/HomePage.stub', base_path('tests/Browser/Pages/HomePage.php'));
        copy(__DIR__.'/../../stubs/DuskTestCase.stub', base_path('tests/DuskTestCase.php'));
        copy(__DIR__.'/../../stubs/Page.stub', base_path('tests/Browser/Pages/Page.php'));

        file_put_contents(base_path('tests/Browser/screenshots/.gitignore'), '*
!.gitignore
');

        $this->info('Dusk scaffolding installed successfully.');
    }
}<commit_msg>allow to run dusk:install as upgrade<commit_after><?php

namespace Laravel\Dusk\Console;

use Illuminate\Console\Command;

class InstallCommand extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'dusk:install';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Install Dusk into the application';

    /**
     * Create a new command instance.
     *
     * @return void
     */
    public function __construct()
    {
        parent::__construct();
    }

    /**
     * Execute the console command.
     *
     * @return mixed
     */
    public function handle()
    {
        if (! is_dir(base_path('tests/Browser/Pages'))) {
            mkdir(base_path('tests/Browser/Pages'), 0755, true);
        }

        if (! is_dir(base_path('tests/Browser/screenshots'))) {
            mkdir(base_path('tests/Browser/screenshots'), 0755, true);
            file_put_contents(base_path('tests/Browser/screenshots/.gitignore'), '*
!.gitignore
');
        }

        if (! is_dir(base_path('tests/Browser/console'))) {
            mkdir(base_path('tests/Browser/console'), 0755, true);
            file_put_contents(base_path('tests/Browser/console/.gitignore'), '*
!.gitignore
');
        }

        $subs = [
            'ExampleTest.stub'  => base_path('tests/Browser/ExampleTest.php'),
            'HomePage.stub'     => base_path('tests/Browser/Pages/HomePage.php'),
            'DuskTestCase.stub' => base_path('tests/DuskTestCase.php'),
            'Page.stub'         => base_path('tests/Browser/Pages/Page.php'),
        ];

        foreach ($subs as $stub => $file) {
            if (! is_file($file)) {
                copy(__DIR__.'/../../stubs/'.$stub, $file);
            }
        }

        $this->info('Dusk scaffolding installed successfully.');
    }
}
{'fraction_non_alphanumeric': 0.15436054611312344, 'fraction_numerical': 0.006687099470604625, 'mean_word_length': 2.242999096657633, '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': '6588660', 'n_tokens_mistral': 1106, 'n_tokens_neox': 1067, 'n_words': 185}