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

/**
 * Auto Loader
 *
 */
require_once( getcwd() . '/vendor/autoload.php');


$path = $_SERVER['argv'][1];

// Check path
if( realpath($path) === false )
{
    // Attempt to resolve path relative to current working dir
    $path = realpath( getcwd() . DIRECTORY_SEPARATOR . $path);
}

if( !file_exists($path) or !is_file($path) or !is_readable($path) )
{
    die('Cannot read config file: ' . $path);
}

echo "Publishing assets in config file: $path\n";

$collection = new dgifford\Assets\Collection($path);

$collection->publish();

echo "Finished.\n";
