mirror of
https://github.com/there4/markdown-resume.git
synced 2024-12-03 08:59:35 -05:00
Checking if --template has a directory separator. Closes #7
This commit is contained in:
parent
d77284f7a6
commit
0c9543b04e
@ -35,7 +35,7 @@ class HtmlCommand extends Command
|
|||||||
'template',
|
'template',
|
||||||
't',
|
't',
|
||||||
InputOption::VALUE_REQUIRED,
|
InputOption::VALUE_REQUIRED,
|
||||||
'Which of the templates to use'
|
'Which of the templates to use. Use an absolute path for a custom template.'
|
||||||
)
|
)
|
||||||
->addOption(
|
->addOption(
|
||||||
'refresh',
|
'refresh',
|
||||||
@ -126,7 +126,13 @@ class HtmlCommand extends Command
|
|||||||
if (!$template) {
|
if (!$template) {
|
||||||
$template = $this->app->defaultTemplate;
|
$template = $this->app->defaultTemplate;
|
||||||
}
|
}
|
||||||
$templatePath = join(DIRECTORY_SEPARATOR, array($this->app->templatePath, basename($template)));
|
|
||||||
|
if (strpos($template, DIRECTORY_SEPARATOR) !== false) {
|
||||||
|
$templatePath = realpath($template);
|
||||||
|
} else {
|
||||||
|
$templatePath = join(DIRECTORY_SEPARATOR, array($this->app->templatePath, basename($template)));
|
||||||
|
}
|
||||||
|
|
||||||
$templateIndexPath = join(DIRECTORY_SEPARATOR, array($templatePath, 'index.html'));
|
$templateIndexPath = join(DIRECTORY_SEPARATOR, array($templatePath, 'index.html'));
|
||||||
|
|
||||||
if (!file_exists($templateIndexPath)) {
|
if (!file_exists($templateIndexPath)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user