Skip to content

Commit

Permalink
fix(includers/openapi): resolve generated input
Browse files Browse the repository at this point in the history
resolve input relative to temporary write path
if includer is not first in execution order
  • Loading branch information
moki committed Dec 29, 2022
1 parent 376068b commit 65f0297
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/services/includers/batteries/openapi/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,13 @@ class OpenApiIncluderError extends Error {
}

async function includerFunction(params: IncluderFunctionParams) {
const {readBasePath, writeBasePath, tocPath, passedParams: {input, leadingPage}} = params;
const {readBasePath, writeBasePath, tocPath, passedParams: {input, leadingPage}, index} = params;

const tocDirPath = dirname(tocPath);

const contentPath = resolve(process.cwd(), readBasePath, input);
const contentPath = index === 0
? resolve(process.cwd(), writeBasePath, input)
: resolve(process.cwd(), readBasePath, input);

const leadingPageName = leadingPage?.name ?? 'Overview';

Expand Down

0 comments on commit 65f0297

Please sign in to comment.