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

(@include_once __DIR__ . '/../vendor/autoload.php') || @include_once __DIR__ . '/../../../autoload.php';

use Blocktrail\SDK\Compiler;

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

try {
    $phar = "blocktrail.phar";

    $compiler = new Compiler();
    $compiler->compile($phar);

    chmod($phar, 0755);
} catch (\Exception $e) {
    echo 'Failed to compile phar: ['.get_class($e).'] '.$e->getMessage().' at '.$e->getFile().':'.$e->getLine();
    exit(1);
}
