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

$projectRoot = dirname(dirname(dirname(dirname(__DIR__)))) . '';
chdir($projectRoot);


if (!defined('APPLICATION_ENV') && getenv('APPLICATION_ENV')) {
    define('APPLICATION_ENV', (getenv('APPLICATION_ENV')
        ? getenv('APPLICATION_ENV')
        : 'production'));
}

if (!file_exists('vendor/autoload.php')) {
    throw new RuntimeException(
        'Garrrr! Unable t\'load Bone. Run `composer install` or `php composer.phar install`'
    );
}

$composer = require_once 'vendor/autoload.php';

use Bone\Console\ConsoleApplication;
use Del\Booty\BootyCommand;

$container = Bone\Application::ahoy()->bootstrap();
/** @var ConsoleApplication $app */
$app = $container->get(ConsoleApplication::class);
$packages = $container->get('packages');
$booty = new BootyCommand('assets', $packages, $composer);
$booty->setName('assets:deploy');
$app->add($booty);
$app->run();
