mirror of
https://github.com/Anduin2017/HowToCook.git
synced 2025-02-08 02:39:22 +08:00
Add validation to manual_lint.js to check for spaces in filenames
This commit is contained in:
parent
295a3cae4c
commit
14117724c4
4
.github/manual_lint.js
vendored
4
.github/manual_lint.js
vendored
|
@ -12,6 +12,10 @@ async function main() {
|
|||
var data = await fs.readFile(filePath, 'utf8');
|
||||
var filename = path.parse(filePath).base.replace(".md","");
|
||||
|
||||
if (filename.includes(' ')) {
|
||||
errors.push(`文件 ${filePath} 不符合仓库的规范!文件名不能包含空格!`);
|
||||
}
|
||||
|
||||
dataLines = data.split('\n').map(t => t.trim());
|
||||
titles = dataLines.filter(t => t.startsWith('#'));
|
||||
secondTitles = titles.filter(t => t.startsWith('## '));
|
||||
|
|
Loading…
Reference in New Issue
Block a user