#!/usr/bin/env php
<?php
$autoloadFile = __DIR__ . '/../vendor/autoload.php';
if (!file_exists($autoloadFile)) {
    $usage = <<<EOL
Dependencies needed before running, install with composer:
wget http://getcomposer.org/composer.phar
php composer.phar install

EOL;
    die($usage);
}

require_once $autoloadFile;

use Deployer\Cli\Application;
use Symfony\Component\Yaml\Yaml;

$app = new Application('Deployer', 'v0.2.0');

$configFile = $app->getRoot() .'/'. Application::CONFIG_FILE;
if (file_exists($configFile) && is_readable($configFile)) {
    $config = Yaml::parse(file_get_contents($configFile));
    $app->setConfig($config);
}

$app->run();
