From a5d73da942a3f33584326068b453f737dae0dd12 Mon Sep 17 00:00:00 2001 From: Mengnan Gong Date: Fri, 3 Jun 2022 14:26:51 +0800 Subject: [PATCH] techdocs-cli: fix the legacyCopyReadmeMdToIndexMd flag in techdocs-cli generate Signed-off-by: Mengnan Gong --- .changeset/happy-boxes-melt.md | 6 ++++++ packages/techdocs-cli/src/commands/generate/generate.ts | 2 +- plugins/techdocs-node/src/stages/generate/techdocs.ts | 6 +++--- 3 files changed, 10 insertions(+), 4 deletions(-) create mode 100644 .changeset/happy-boxes-melt.md diff --git a/.changeset/happy-boxes-melt.md b/.changeset/happy-boxes-melt.md new file mode 100644 index 0000000000..c478e783d3 --- /dev/null +++ b/.changeset/happy-boxes-melt.md @@ -0,0 +1,6 @@ +--- +'@techdocs/cli': patch +'@backstage/plugin-techdocs-node': patch +--- + +Fix the flag parsing for `legacyCopyReadmeMdToIndexMd` in `techdocs-cli generate` command, and decouple it's logic from the `techdocs-ref` flag. diff --git a/packages/techdocs-cli/src/commands/generate/generate.ts b/packages/techdocs-cli/src/commands/generate/generate.ts index 309b9c7969..1e4ed220d9 100644 --- a/packages/techdocs-cli/src/commands/generate/generate.ts +++ b/packages/techdocs-cli/src/commands/generate/generate.ts @@ -57,8 +57,8 @@ export default async function generate(opts: OptionValues) { runIn: opts.docker ? 'docker' : 'local', dockerImage, pullImage, - legacyCopyReadmeMdToIndexMd, mkdocs: { + legacyCopyReadmeMdToIndexMd, omitTechdocsCorePlugin, }, }, diff --git a/plugins/techdocs-node/src/stages/generate/techdocs.ts b/plugins/techdocs-node/src/stages/generate/techdocs.ts index 660b8e8cb5..e3debab526 100644 --- a/plugins/techdocs-node/src/stages/generate/techdocs.ts +++ b/plugins/techdocs-node/src/stages/generate/techdocs.ts @@ -111,10 +111,10 @@ export class TechdocsGenerator implements GeneratorBase { parsedLocationAnnotation, this.scmIntegrations, ); + } - if (this.options.legacyCopyReadmeMdToIndexMd) { - await patchIndexPreBuild({ inputDir, logger: childLogger, docsDir }); - } + if (this.options.legacyCopyReadmeMdToIndexMd) { + await patchIndexPreBuild({ inputDir, logger: childLogger, docsDir }); } if (!this.options.omitTechdocsCoreMkdocsPlugin) {