upd(codegen): follow golang standard pkg layout
This commit is contained in:
@@ -21,14 +21,14 @@ $cleanUp = function($contents) {
|
||||
|
||||
foreach ($apis as $k => $api) {
|
||||
$entrypoint = $api['entrypoint'];
|
||||
$filename_md = $dirname . "/src/" . $entrypoint . "/index.md";
|
||||
$filename_md = $api['dirname'] . $entrypoint . "/index.md";
|
||||
if (file_exists($filename_md)) {
|
||||
$api['description'] = file_get_contents($filename_md);
|
||||
}
|
||||
|
||||
foreach ($api['apis'] as $key => $call) {
|
||||
$name = $call['name'];
|
||||
$filename_md = $dirname . "/src/" . $entrypoint . "/" . $name . ".md";
|
||||
$filename_md = $api['dirname'] . $entrypoint . "/" . $name . ".md";
|
||||
if (file_exists($filename_md)) {
|
||||
$call['description'] = file_get_contents($filename_md);
|
||||
}
|
||||
@@ -40,4 +40,5 @@ foreach ($apis as $k => $api) {
|
||||
|
||||
$tpl->load("README.tpl");
|
||||
$tpl->assign("apis", $apis);
|
||||
file_put_contents($dirname . "/README.md", $cleanUp($tpl->get()));
|
||||
file_put_contents($dirname . "README.md", $cleanUp($tpl->get()));
|
||||
echo $dirname . "README.md\n";
|
||||
Reference in New Issue
Block a user