提交 f500726e authored 作者: christian.peter.io's avatar christian.peter.io

UpgradeCreator didn't run on Windows

上级 c00205f3
...@@ -44,10 +44,10 @@ public class UpgradeCreator { ...@@ -44,10 +44,10 @@ public class UpgradeCreator {
private static void convert(File file, File srcDir, File destDir) throws Exception { private static void convert(File file, File srcDir, File destDir) throws Exception {
String pathInDestDir = file.getCanonicalPath().substring(srcDir.getCanonicalPath().length()); String pathInDestDir = file.getCanonicalPath().substring(srcDir.getCanonicalPath().length());
pathInDestDir = pathInDestDir.replaceAll("org" + File.separator + "h2", pathInDestDir = pathInDestDir.replaceAll("org" + getFsRegexEscaped() + "h2",
"org" + File.separator + "org" + getFsRegexEscaped() +
"h2" + File.separator + "h2" + getFsRegexEscaped() +
"upgrade" + File.separator + "upgrade" + getFsRegexEscaped() +
"v1_1"); "v1_1");
File fileInDestDir = new File(destDir, pathInDestDir); File fileInDestDir = new File(destDir, pathInDestDir);
// System.out.println(fileInDestDir.getAbsoluteFile()); // System.out.println(fileInDestDir.getAbsoluteFile());
...@@ -90,5 +90,11 @@ public class UpgradeCreator { ...@@ -90,5 +90,11 @@ public class UpgradeCreator {
return false; return false;
} }
private static String getFsRegexEscaped() {
String result = File.separator;
if (result.equals("\\")) {
result = "\\\\";
}
return result;
}
} }
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论