三级目录
This commit is contained in:
@@ -55,10 +55,14 @@ function extractInfoFromJSFolder(folderPath) {
|
||||
|
||||
function extractInfoFromPathingFile(filePath, parentFolders) {
|
||||
const content = JSON.parse(fs.readFileSync(filePath, 'utf8'));
|
||||
let tags = parentFolders.slice(2) // 从第三个元素开始,跳过 'pathing' 和下一级目录
|
||||
.map(tag => tag.split('@')[0]) // 取@符号前面的数据
|
||||
.filter((tag, index, self) => self.indexOf(tag) === index); // 去重
|
||||
|
||||
return {
|
||||
author: content.info && content.info.author ? content.info.author : '',
|
||||
description: convertNewlines(content.info && content.info.description ? content.info.description : ''),
|
||||
tags: parentFolders.slice(2) // 从第三个元素开始,跳过 'pathing' 和下一级目录
|
||||
tags: tags
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user