#!/usr/bin/env php
<?php

// Load the composer autoload
foreach([__DIR__ . '/../../../autoload.php', __DIR__ . '/../autoload.php', __DIR__ . '/../vendor/autoload.php'] as $file) {
    if (file_exists($file)) {
        require $file;
    }
}

putenv('AUTOTASK_GENERATOR_DIRECTORY='.getcwd());

// Load the environment variables
if (file_exists(getenv('AUTOTASK_GENERATOR_DIRECTORY') . '/.env')) {
    $dotenv = Dotenv\Dotenv::createImmutable(getenv('AUTOTASK_GENERATOR_DIRECTORY'));
    $dotenv->load();
}

// Setup our console app
$application = new Symfony\Component\Console\Application();
$application->add( new Anteris\Autotask\Generator\Commands\MakeEndpointCommand() );
$application->add( new Anteris\Autotask\Generator\Commands\MakeDefaultsCommand() );
$application->add( new Anteris\Autotask\Generator\Commands\MakeSupportFilesCommand() );
$application->run();
