Skip to content

Commit 121a75e

Browse files
authored
Fix invalid ignore pattern for underscore files (#233)
1 parent c33e6a5 commit 121a75e

File tree

1 file changed

+3
-16
lines changed
  • packages/docusaurus-plugin-openapi/src/openapi

1 file changed

+3
-16
lines changed

packages/docusaurus-plugin-openapi/src/openapi/openapi.ts

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,7 @@
77

88
import path from "path";
99

10-
import {
11-
aliasedSitePath,
12-
Globby,
13-
GlobExcludeDefault,
14-
normalizeUrl,
15-
} from "@docusaurus/utils";
10+
import { aliasedSitePath, Globby, normalizeUrl } from "@docusaurus/utils";
1611
import axios from "axios";
1712
import chalk from "chalk";
1813
import fs from "fs-extra";
@@ -236,19 +231,11 @@ export async function readOpenapiFiles(
236231
);
237232

238233
// TODO: Add config for inlcude/ignore
239-
const allFiles = await Globby(["**/*.{json,yaml,yml}"], {
234+
const sources = await Globby(["**/*.{json,yaml,yml}"], {
240235
cwd: openapiPath,
241-
ignore: GlobExcludeDefault,
236+
ignore: ["**/_category_.{json,yaml,yml}"],
242237
});
243238

244-
// Explicitly look for _spec_ files, which are excluded by default since they start with _
245-
allFiles.push(
246-
...(await Globby(["**/_spec_.{json,yaml,yml}"], {
247-
cwd: openapiPath,
248-
}))
249-
);
250-
251-
const sources = allFiles.filter((x) => !x.includes("_category_")); // todo: regex exclude?
252239
return Promise.all(
253240
sources.map(async (source) => {
254241
// TODO: make a function for this

0 commit comments

Comments
 (0)