Merge pull request #1 from kevinxucs/master

Add parameter for setting output directory.
This commit is contained in:
Craig Davis 2013-09-05 10:25:08 -07:00
commit e96775b668

17
bin/resume.php Normal file → Executable file
View File

@ -1,3 +1,4 @@
#!/usr/bin/env php
<?php <?php
define('APPLICATION_BASE_PATH', realpath(__DIR__ . '/..')); define('APPLICATION_BASE_PATH', realpath(__DIR__ . '/..'));
@ -16,6 +17,7 @@ use Assetic\Filter;
// Application defaults // Application defaults
$config = (object) array( $config = (object) array(
"source" => "", "source" => "",
"output" => "./output/",
"template" => "modern", "template" => "modern",
"refresh" => false, "refresh" => false,
"pdf" => false "pdf" => false
@ -23,10 +25,11 @@ $config = (object) array(
// Command line arguments to populate the config // Command line arguments to populate the config
$opts = array( $opts = array(
"s:" => "source:", // source "s:" => "source:", // source
"t:" => "template:", // template "o:" => "output:", // output
"r" => "refresh", // refresh "t:" => "template:", // template
"p" => "pdf" // pdf output "r" => "refresh", // refresh
"p" => "pdf" // pdf output
); );
// Fetch the options from the command line arguments // Fetch the options from the command line arguments
@ -53,9 +56,9 @@ if (empty($config->source)) {
$basename = pathinfo($config->source, PATHINFO_FILENAME); $basename = pathinfo($config->source, PATHINFO_FILENAME);
$template_path = realpath(__DIR__ . '/../templates/' . $config->template); $template_path = realpath(__DIR__ . '/../templates/' . $config->template);
$pdf_source = './output/' . $basename . '-pdf.html'; $pdf_source = $config->output . '/' . $basename . '-pdf.html';
$output = './output/' . $basename . '.html'; $output = $config->output . '/' . $basename . '.html';
$pdf_output = './output/' . $basename . '.pdf'; $pdf_output = $config->output . '/' . $basename . '.pdf';
if (!file_exists($config->source)) { if (!file_exists($config->source)) {
exit("Please specify a valid source file.\n"); exit("Please specify a valid source file.\n");