This commit is contained in:
zhangqian 2026-06-04 14:32:11 +08:00
parent d44fed3744
commit 40d5e0e603
2 changed files with 7 additions and 8 deletions

View File

@ -26,13 +26,12 @@ public class BitFunController {
@PostMapping("/open")
public Map<String, Object> open(@RequestBody BitFunReq request) throws Exception {
System.out.println("开始测试--------------------------");
System.out.println("正在打开BITFUN--------------------------");
String projectName = safeName(request.getProjectName());
String branch = safeName(request.getBranch());
String codeName = safeName(request.getCodeName());
String workspaceName = codeName + projectName + "-" + branch;
Path workspacePath = Paths.get(bitFunProperties.getWorkspaceRoot(), workspaceName);
Path workspacePath = Paths.get(bitFunProperties.getWorkspaceRoot(), projectName, codeName, branch);
Files.createDirectories(workspacePath);
@ -54,7 +53,7 @@ public class BitFunController {
gitClone.directory(workspacePath.toFile());
gitClone.inheritIO();
System.out.println("执行 Git 命令: git clone -b " + request.getBranch() + " " + request.getGitUrl() + " .");
int cloneExitCode = gitClone.start().waitFor();
if (cloneExitCode != 0) {
@ -90,4 +89,4 @@ public class BitFunController {
}
return value.replaceAll("[\\\\/:*?\"<>|]", "-").trim();
}
}
}

View File

@ -2,6 +2,6 @@ server:
port: 8089
bitfun:
workspace-root: D:\workpsace-temp
install-dir: D:\bitfun
exe-path: D:\bitfun\bitfun-desktop.exe
workspace-root: E:\workspace-template
install-dir: E:\workSpace\soft-temp\BitFun
exe-path: E:\workSpace\soft-temp\BitFun\bitfun-desktop.exe