Skip to content

Commit

Permalink
Fix zrpc code generation error on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
anqiansong committed May 4, 2022
1 parent 0895853 commit fd6386b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {
}

group 'cn.xiaoheiban'
version '1.1.0'
version '1.1.1'

repositories {
mavenCentral()
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/cn/xiaoheiban/action/RpcAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ private void generateRpc(Project project, String goctlHome, String protoPath, St
ProgressManager.getInstance().run(new Task.Backgroundable(project, "generating rpc ...") {
@Override
public void run(@NotNull ProgressIndicator indicator) {
String protoDir = FileUtil.getDirectoryname(src);
File srcFile = new File(src);
String protoDir = srcFile.getParent();
String command = "rpc protoc -I " + protoDir;
if (!StringUtil.isEmptyOrSpaces(protoPath) && !protoPath.equals(protoDir)) {
command += " -I " + protoPath;
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/cn/xiaoheiban/action/RpcQuickAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ private void generateRpc(Project project, String goctlHome, String protoPath, St
ProgressManager.getInstance().run(new Task.Backgroundable(project, "generating rpc ...") {
@Override
public void run(@NotNull ProgressIndicator indicator) {
String protoDir = FileUtil.getDirectoryname(src);
File srcFile = new File(src);
String protoDir = srcFile.getParent();
String command = "rpc protoc -I " + protoDir;
if (!StringUtil.isEmptyOrSpaces(protoPath) && !protoPath.equals(protoDir)) {
command += " -I " + protoPath;
Expand Down

0 comments on commit fd6386b

Please sign in to comment.