#!/usr/bin/env php
<?php
declare(strict_types = 1);

$paths = [
    __DIR__.'/vendor/autoload.php',
    __DIR__ . '/../../autoload.php',
];

foreach ($paths as $file) {
    if (file_exists($file)) {
        require $file;

        break;
    }
}

use Innmind\CLI\{
    Main,
    Environment,
};
use Innmind\Url\Path;
use Innmind\OperatingSystem\OperatingSystem;
use function Series\bootstrap;

new class extends Main {
    protected function main(Environment $env, OperatingSystem $os): void
    {
        $run = bootstrap(
            $os->filesystem()->mount(Path::of($env->variables()->get('HOME').'/.series/')),
            $os->remote()->http(),
            $os->clock(),
            $os->sockets(),
        );
        $run($env);
    }
};
