Skip to content

Commit fd6386b

Browse files
author
anqiansong
committed
Fix zrpc code generation error on Windows
1 parent 0895853 commit fd6386b

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ plugins {
55
}
66

77
group 'cn.xiaoheiban'
8-
version '1.1.0'
8+
version '1.1.1'
99

1010
repositories {
1111
mavenCentral()

src/main/java/cn/xiaoheiban/action/RpcAction.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ private void generateRpc(Project project, String goctlHome, String protoPath, St
7777
ProgressManager.getInstance().run(new Task.Backgroundable(project, "generating rpc ...") {
7878
@Override
7979
public void run(@NotNull ProgressIndicator indicator) {
80-
String protoDir = FileUtil.getDirectoryname(src);
80+
File srcFile = new File(src);
81+
String protoDir = srcFile.getParent();
8182
String command = "rpc protoc -I " + protoDir;
8283
if (!StringUtil.isEmptyOrSpaces(protoPath) && !protoPath.equals(protoDir)) {
8384
command += " -I " + protoPath;

src/main/java/cn/xiaoheiban/action/RpcQuickAction.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ private void generateRpc(Project project, String goctlHome, String protoPath, St
8181
ProgressManager.getInstance().run(new Task.Backgroundable(project, "generating rpc ...") {
8282
@Override
8383
public void run(@NotNull ProgressIndicator indicator) {
84-
String protoDir = FileUtil.getDirectoryname(src);
84+
File srcFile = new File(src);
85+
String protoDir = srcFile.getParent();
8586
String command = "rpc protoc -I " + protoDir;
8687
if (!StringUtil.isEmptyOrSpaces(protoPath) && !protoPath.equals(protoDir)) {
8788
command += " -I " + protoPath;

0 commit comments

Comments
 (0)