You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
455 B
15 lines
455 B
5 years ago
|
const path = require('path');
|
||
|
const yfm = require('yaml-front-matter');
|
||
|
const glob = require('glob');
|
||
|
const fs = require('fs-extra');
|
||
|
|
||
|
const demoFiles = glob.sync(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}`);
|
||
|
}
|
||
|
}
|