loom-spinner-cli/bin/loom

30 lines
No EOL
801 B
PHP
Executable file

#!/usr/bin/env php
<?php
use Loom\Spinner\Command\DestroyCommand;
use Loom\Spinner\Command\SpinCommand;
use Loom\Spinner\Command\StartCommand;
use Loom\Spinner\Command\StopCommand;
use Symfony\Component\Console\Application;
$localAutoloadPath = sprintf('%s/vendor/autoload.php', dirname(__DIR__));
$installedAutoloadPath = sprintf('%s/autoload.php', dirname(__DIR__, 3));
if (file_exists($localAutoloadPath)) {
require $localAutoloadPath;
} else {
require $installedAutoloadPath;
}
$application = new Application('Loom Spinner');
$application->add(new DestroyCommand());
$application->add(new SpinCommand());
$application->add(new StartCommand());
$application->add(new StopCommand());
try {
$application->run();
} catch (\Exception $exception) {
die($exception->getMessage());
}