mirror of
https://github.com/there4/markdown-resume.git
synced 2024-12-03 08:59:35 -05:00
Merge pull request #1 from kevinxucs/master
Add parameter for setting output directory.
This commit is contained in:
commit
e96775b668
9
bin/resume.php
Normal file → Executable file
9
bin/resume.php
Normal file → Executable 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
|
||||||
@ -24,6 +26,7 @@ $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
|
||||||
|
"o:" => "output:", // output
|
||||||
"t:" => "template:", // template
|
"t:" => "template:", // template
|
||||||
"r" => "refresh", // refresh
|
"r" => "refresh", // refresh
|
||||||
"p" => "pdf" // pdf output
|
"p" => "pdf" // pdf output
|
||||||
@ -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");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user