mirror of
https://github.com/ant-design/ant-design.git
synced 2025-01-18 14:13:37 +08:00
5b23a6aac2
* chore(deps-dev): bump glob from 9.3.5 to 10.0.0 Bumps [glob](https://github.com/isaacs/node-glob) from 9.3.5 to 10.0.0. - [Release notes](https://github.com/isaacs/node-glob/releases) - [Changelog](https://github.com/isaacs/node-glob/blob/main/changelog.md) - [Commits](https://github.com/isaacs/node-glob/compare/v9.3.5...v10.0.0) --- updated-dependencies: - dependency-name: glob dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * chore: upgrade glob usage --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: afc163 <afc163@gmail.com>
15 lines
456 B
JavaScript
15 lines
456 B
JavaScript
const path = require('path');
|
|
const yfm = require('yaml-front-matter');
|
|
const { globSync } = require('glob');
|
|
const fs = require('fs');
|
|
|
|
const demoFiles = globSync(path.join(process.cwd(), 'components/**/demo/*.md'));
|
|
// eslint-disable-next-line no-restricted-syntax
|
|
for (const url of demoFiles) {
|
|
const demoContent = fs.readFileSync(url);
|
|
const meta = yfm.loadFront(demoContent);
|
|
if (meta.only) {
|
|
throw Error(`there is a 'only': ${url}`);
|
|
}
|
|
}
|