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

namespace Fluxter\FXRelease;

$possibleFiles = [
    __DIR__.'/../../autoload.php',  // Installed globally
    __DIR__.'/../autoload.php',  // ?
    __DIR__.'/vendor/autoload.php' // Installed locally
];

$file = null;
foreach ($possibleFiles as $possibleFile) {
    if (file_exists($possibleFile)) {
        $file = $possibleFile;

        break;
    }
}

if (null === $file) {
    throw new \RuntimeException('Unable to locate autoload.php file.');
}

require_once $file;

use Symfony\Component\Console\Application;
use Fluxter\FXRelease\Command\ReleaseCommand;

$application = new Application();
$application->add(new ReleaseCommand());
$application->run();
