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

View File

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