diff --git a/src/RepositoryDir.php b/src/RepositoryDir.php index 07e33667..08f23fd0 100644 --- a/src/RepositoryDir.php +++ b/src/RepositoryDir.php @@ -34,6 +34,7 @@ class RepositoryDir extends RepositoryBase { if (preg_match("/^([0-9a-zA-Z_\-]+)\.json$/", $f, $m) && $f !== 'package.json') { $d1 = json_decode(file_get_contents("{$this->path}/{$f}"), true); $d1['format'] = 'json'; + $d1['fileName'] = $f; if (!$this->isCategory($d1)) { continue; @@ -45,6 +46,7 @@ class RepositoryDir extends RepositoryBase { if (preg_match("/^([0-9a-zA-Z_\-]+)\.yaml$/", $f, $m)) { $d1 = yaml_parse(file_get_contents("{$this->path}/{$f}")); $d1['format'] = 'yaml'; + $d1['fileName'] = $f; if (!$this->isCategory($d1)) { continue; diff --git a/src/RepositoryGit.php b/src/RepositoryGit.php index 6a95c89e..536e9072 100644 --- a/src/RepositoryGit.php +++ b/src/RepositoryGit.php @@ -72,6 +72,7 @@ class RepositoryGit extends RepositoryBase { $d1 = json_decode(shell_exec("cd " . escapeShellArg($this->path) . "; git show {$this->branchEsc}:" . escapeShellArg($f)), true); $d1['format'] = 'json'; + $d1['fileName'] = $f; if (!$this->isCategory($d1)) { continue; @@ -86,6 +87,7 @@ class RepositoryGit extends RepositoryBase { $d1 = yaml_parse(shell_exec("cd " . escapeShellArg($this->path) . "; git show {$this->branchEsc}:" . escapeShellArg($f))); $d1['format'] = 'yaml'; + $d1['fileName'] = $f; if (!$this->isCategory($d1)) { continue;