2017-10-19 16:42:54 -07:00
|
|
|
#!/usr/bin/env php
|
2014-01-12 13:42:25 -07:00
|
|
|
<?php
|
2015-03-16 07:23:51 -06:00
|
|
|
error_reporting(E_ALL | E_STRICT);
|
|
|
|
|
2017-10-19 16:42:54 -07:00
|
|
|
$baseDir = dirname(__DIR__);
|
|
|
|
$templatePath = $baseDir . '/templates';
|
|
|
|
$consoleTemplatePath = $baseDir . '/src/Resume/Templates';
|
|
|
|
|
2015-03-16 07:23:51 -06:00
|
|
|
// If the dependencies aren't installed, we have to bail and offer some help.
|
2017-10-19 16:42:54 -07:00
|
|
|
if (!file_exists($baseDir . '/vendor/autoload.php')) {
|
2015-03-16 07:23:51 -06:00
|
|
|
exit("\nPlease run `composer install` to install dependencies.\n\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
// Bootstrap our application with the Composer autoloader
|
2017-10-19 16:42:54 -07:00
|
|
|
$app = include $baseDir . '/vendor/autoload.php';
|
2015-03-16 07:23:51 -06:00
|
|
|
|
|
|
|
// Setup the namespace for our own namespace
|
2017-10-19 16:42:54 -07:00
|
|
|
$app->add('Resume', $baseDir . '/src');
|
2015-03-16 07:23:51 -06:00
|
|
|
|
|
|
|
// Instantiate our Console application
|
|
|
|
$console = new Resume\Cli\Resume();
|
|
|
|
|
2017-10-19 16:42:54 -07:00
|
|
|
// Fetch the version
|
|
|
|
chdir($baseDir);
|
|
|
|
$versionCmd = 'git describe --abbrev=0 --tags';
|
|
|
|
$version = trim(shell_exec($versionCmd));
|
2015-03-16 07:23:51 -06:00
|
|
|
|
2017-10-19 16:42:54 -07:00
|
|
|
// Fetch the project name and description
|
|
|
|
$project = json_decode(file_get_contents(__DIR__ . '/../composer.json'));
|
|
|
|
$project->version = $version;
|
2015-03-16 07:23:51 -06:00
|
|
|
|
|
|
|
// Init the app with these params
|
|
|
|
$console->initialize($templatePath, $consoleTemplatePath, $project);
|
|
|
|
|
|
|
|
// Execute the console app.
|
|
|
|
$console->run();
|
|
|
|
|
|
|
|
/* End of resume.php */
|