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

require __DIR__ . '/../src/bootstrap.php';

error_reporting(-1);
ini_set('display_errors', 1);

// destination path and filename
$filename = 'bin/environaut.phar';

try
{
    $compiler = new Environaut\PharCompiler();
    echo "Creating PHP archive '$filename'...";
    $compiler->create($filename);
    echo "done." . PHP_EOL;
    echo "Use 'bin/phar $filename' to list files." . PHP_EOL;
}
catch (\Exception $e)
{
    echo "Failed to compile '$filename': " . $e->getMessage() . PHP_EOL;
    echo $e->getTraceAsString() . PHP_EOL;
    exit(1);
}

