refactor: 重构部署功能

This commit is contained in:
2026-01-08 19:50:58 +08:00
parent a067d167e9
commit db2b2af0d3
13 changed files with 79 additions and 97 deletions

View File

@@ -68,27 +68,21 @@ export class ProjectController {
throw new BusinessError('项目不存在', 1002, 404);
}
// 获取工作目录状态信息
// 获取工作目录状态信息(不包含目录大小)
let workspaceStatus = null;
if (project.projectDir) {
try {
const status = await GitManager.checkWorkspaceStatus(
project.projectDir,
);
let size = 0;
let gitInfo = null;
if (status.exists && !status.isEmpty) {
size = await GitManager.getDirectorySize(project.projectDir);
}
if (status.hasGit) {
gitInfo = await GitManager.getGitInfo(project.projectDir);
}
workspaceStatus = {
...status,
size,
gitInfo,
};
} catch (error) {