fix repos containing supplementary .md files
authorMichael Wallner <mike@php.net>
Tue, 19 Jan 2016 07:59:07 +0000 (08:59 +0100)
committerMichael Wallner <mike@php.net>
Tue, 19 Jan 2016 07:59:07 +0000 (08:59 +0100)
mdref/Tree.php

index dd27d6fd0f94ca8616031f1127a3d14a38f0ac59..8f6c7739f6eaca5fea832fe847ae133ad4657823 100644 (file)
@@ -26,7 +26,9 @@ class Tree implements \RecursiveIterator {
         * @param \mdref\Repo $repo
         */
        public function __construct($path, Repo $repo) {
-               if (!($list = glob("$path/*.md"))) {
+               if (realpath($path)."/" === $repo->getPath()) {
+                       $list = [$path ."/". $repo->getName() .".md"];
+               } elseif (!($list = glob("$path/*.md"))) {
                        $list = glob("$path/*/*.md");
                }
                if ($list) {