Skip to content

Commit b92018f

Browse files
authored
Merge pull request #608 from kouzuqi7/master
修复windows环境下的路径问题
2 parents da7d53f + f678a48 commit b92018f

File tree

1 file changed

+4
-1
lines changed
  • waterdrop-core/src/main/scala/io/github/interestinglab/waterdrop/config

1 file changed

+4
-1
lines changed

waterdrop-core/src/main/scala/io/github/interestinglab/waterdrop/config/Common.scala

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,10 @@ object Common {
4848
this.mode match {
4949
case Some("client") => {
5050

51-
val path = Common.getClass.getProtectionDomain.getCodeSource.getLocation.toURI.getPath
51+
var path = Common.getClass.getProtectionDomain.getCodeSource.getLocation.toURI.getPath
52+
if (System.getProperties().getProperty("os.name").toUpperCase().indexOf("WINDOWS") != -1) {
53+
path = path.substring(1)
54+
}
5255
Paths.get(path).getParent.getParent
5356
}
5457

0 commit comments

Comments
 (0)