mirror of https://github.com/Rekoe/rk_svnadmin
fix
parent
b41bf9b25d
commit
ace8f8ee1d
|
@ -1,8 +1,10 @@
|
|||
package com.rekoe.service;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
|
||||
import com.rekoe.domain.Pj;
|
||||
import com.rekoe.domain.ProjectConfig;
|
||||
|
||||
/**
|
||||
|
@ -34,4 +36,17 @@ public class ProjectConfigService extends BaseService<ProjectConfig> {
|
|||
public void init() {
|
||||
get();
|
||||
}
|
||||
|
||||
public String getRepoPath(String pj) {
|
||||
ProjectConfig conf = get();
|
||||
String path = conf.getRepositoryPath();
|
||||
if (!StringUtils.endsWith(path, "/") || !StringUtils.endsWith(path, "\\")) {
|
||||
path += "/";
|
||||
}
|
||||
return path + pj;
|
||||
}
|
||||
|
||||
public String getRepoPath(Pj pj) {
|
||||
return getRepoPath(pj.getPj());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -56,6 +56,9 @@ public class SvnService {
|
|||
@Inject
|
||||
private ProjectGroupUsrService projectGroupUsrService;
|
||||
|
||||
@Inject
|
||||
private ProjectConfigService projectConfigService;
|
||||
|
||||
/**
|
||||
* 导出到配置文件
|
||||
*
|
||||
|
@ -76,7 +79,8 @@ public class SvnService {
|
|||
if (pj == null) {
|
||||
return;
|
||||
}
|
||||
File parent = new File(pj.getPath());
|
||||
String path = projectConfigService.get().getRepositoryPath() + pj.getPj();
|
||||
File parent = new File(path);
|
||||
if (!parent.exists() || !parent.isDirectory()) {
|
||||
throw new RuntimeException(String.format("找不到仓库 路径 %s", pj.getPath()));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue