lijianan
2 years ago
committed by
GitHub
3 changed files with 1 additions and 19 deletions
@ -1,14 +0,0 @@ |
|||||
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}`); |
|
||||
} |
|
||||
} |
|
Loading…
Reference in new issue