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

use BiSight\Etl\Console\Application;

date_default_timezone_set('UTC');

$loader = __DIR__ . '/../vendor/autoload.php';

if (!file_exists($loader)) {
    $loader = __DIR__ . '/../../../autoload.php';
}

if (!file_exists($loader)) {
    die(
        'You must set up the project dependencies, run the following commands:' . PHP_EOL .
        'curl -s http://getcomposer.org/installer | php' . PHP_EOL .
        'php composer.phar install' . PHP_EOL
    );
}

require $loader;

$application = new Application('BiSight console tools', Application::VERSION);
$application->setCatchExceptions(true);
$application->add(new \BiSight\Etl\Command\EtlRunCommand());
$application->add(new \BiSight\Etl\Command\SelfUpdateCommand());
$application->run();
