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

if ($uri = \Phar::running()) {
    require_once "$uri/../vendor/autoload.php";
} elseif (file_exists(__DIR__ . '/../vendor/autoload.php')) {
    require_once __DIR__ . '/../vendor/autoload.php';
} elseif (file_exists(__DIR__ . '/../../../../vendor/autoload.php')) {
    require_once __DIR__ . '/../../../../vendor/autoload.php';
} else {
    throw new \Exception('Could not find any autoloader');
}

$application = new \Symfony\Component\Console\Application('phpstorm-downloader', '1.0.9');
$application->add(new \CMuench\PHPStormDownloader\Command\DownloadCommand());
$application->add(new \CMuench\PHPStormDownloader\Command\CleanCommand());
$application->run();
