feat: sync full workspace including web modules, docs, and configurations to Gitea
Optimized the root .gitignore to exclude virtual environments, node modules, and temp folders to ensure clean and lightweight version tracking. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
17
axhub-make/vite-plugins/utils/fileUtils.ts
Normal file
17
axhub-make/vite-plugins/utils/fileUtils.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import fs from 'fs';
|
||||
|
||||
/**
|
||||
* 从文件注释中读取显示名称
|
||||
*/
|
||||
export function getDisplayName(filePath: string): string | null {
|
||||
try {
|
||||
const content = fs.readFileSync(filePath, 'utf8');
|
||||
const nameMatch = content.match(/@(?:name|displayName)\s+(.+)/);
|
||||
if (nameMatch && nameMatch[1]) {
|
||||
return nameMatch[1].trim();
|
||||
}
|
||||
} catch (err) {
|
||||
// 忽略读取错误
|
||||
}
|
||||
return null;
|
||||
}
|
||||
Reference in New Issue
Block a user