#!/usr/bin/php
<?php

namespace Codger\Generate;

$dir = getcwd();
require_once "$dir/vendor/autoload.php";

if (!isset($argv[1])) {
    fwrite(STDERR, <<<EOT

Pass at least one argument (the name of the recipe) to `vendor/bin/codger`.


EOT
    );
    exit(Bootstrap::ERROR_NO_RECIPE);
}

$config = file_exists("$dir/Codger.json") ? json_decode(file_get_contents("$dir/Codger.json")) : null;
$runner = new Bootstrap($argv[1], $config);
$runner->run(...Bootstrap::arguments());

