Skip to content

Commit

Permalink
Merge pull request #259 from exexute/main
Browse files Browse the repository at this point in the history
fix: agent path incorrent
  • Loading branch information
Nizernizer authored Feb 23, 2022
2 parents 7ba638c + 1922fae commit c8b2b64
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion dongtai-agent/src/main/java/io/dongtai/iast/agent/Agent.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,13 @@ private static String[] parseAgentArgs(String[] args) throws ParseException {
if (result.hasOption("p") && result.hasOption("m")) {
String pid = result.getOptionValue("p");
String mode = result.getOptionValue("m");
StringBuilder attachArgs = new StringBuilder(AGENT_PATH + "=");
StringBuilder attachArgs = new StringBuilder();
if (isWindows() && AGENT_PATH.startsWith("/")) {
attachArgs.append(AGENT_PATH.substring(1)).append("=");
} else {
attachArgs.append(AGENT_PATH).append("=");
}

attachArgs.append("mode=").append(mode);
if (result.hasOption("debug")) {
attachArgs.append("&debug=").append(result.getOptionValue("debug"));
Expand Down

0 comments on commit c8b2b64

Please sign in to comment.