修改了拉取文件的保存名字的形式,现在/改成-显示,可用中文
This commit is contained in:
@@ -242,10 +242,15 @@ class GitService {
|
||||
*/
|
||||
static generateModuleFolderName(url, branch) {
|
||||
const repoName = url.split('/').pop()?.replace('.git', '') || 'unknown-repo';
|
||||
const branchSafeName = branch.replace(/[^a-zA-Z0-9-_]/g, '-');
|
||||
let folderName = branch.trim();
|
||||
folderName = folderName.replace(/^\/+/, "").replace(/\/+$/, ""); // 去掉两端 "/"
|
||||
folderName = folderName.replace(/\//g, "-"); // "/" 转为 "-"
|
||||
folderName = folderName.replace(/[<>:"\\|?*\r\n\t]/g, "-"); // 替换 Windows 不允许的字符
|
||||
if (!folderName)
|
||||
folderName = "default"; // 空的 fallback
|
||||
return {
|
||||
displayName: repoName,
|
||||
folderName: branchSafeName
|
||||
folderName
|
||||
};
|
||||
}
|
||||
/**
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user