Merge pull request #26 from there4/issue-24-template-list

Release 2.0.6: Issue 24 template list
This commit is contained in:
Craig Davis 2014-04-28 10:13:49 -05:00
commit 0ac35d16a8
5 changed files with 13 additions and 7 deletions

View File

@ -24,7 +24,7 @@ at the [blog post for the project][blog].
## Help
```
Markdown Resume Generator version 2.0.5 by Craig Davis
Markdown Resume Generator version 2.0.6 by Craig Davis
Usage:
[options] command [arguments]
@ -100,6 +100,7 @@ are a more comfortable with html than markdown, you should use it.
## Changelog
* __2.0.6__ : Fix empty template list from phar file to close #24
* __2.0.5__ : Remove default value for the `--refresh` option to close #22
* __2.0.4__ : Fix path resolution problem with absolute paths to close #16
* __2.0.3__ : Add optional duration to the `--refresh` option to close #15

Binary file not shown.

View File

@ -8,7 +8,7 @@
"html5"
],
"license": "MIT",
"version": "2.0.5",
"version": "2.0.6",
"selfupdatepath": "://github.com/there4/markdown-resume/raw/master/bin/md2resume",
"selfupdateversion": "://github.com/there4/markdown-resume/raw/master/version",
"authors": [

View File

@ -18,11 +18,16 @@ class TemplatesCommand extends Command
{
$this->app = $this->getApplication();
$tplData = array('templates' => array());
foreach (glob($this->app->templatePath . '/*', GLOB_ONLYDIR) as $dir) {
foreach (new \DirectoryIterator($this->app->templatePath) as $fileInfo) {
if ($fileInfo->isDot() || !$fileInfo->isDir()) {
continue;
}
$descriptionPath = $fileInfo->getPathname() . '/description.txt';
print $descriptionPath . "\n";
$tplData['templates'][] = (object) array(
'name' => basename($dir),
'description' => file_exists($dir . '/description.txt')
? trim(file_get_contents($dir . '/description.txt'))
'name' => $fileInfo->getBasename(),
'description' => file_exists($descriptionPath)
? trim(file_get_contents($descriptionPath))
: 'No description available'
);
}

View File

@ -1 +1 @@
2.0.5
2.0.6