Skip to content

Commit bfb3348

Browse files
authored
Merge pull request VIPJoey#8 from fengye199312/feature/doe_v1.2.0
添加mac版本cmd
2 parents 3c2ee9c + 34f43d8 commit bfb3348

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/client/ProcessClient.java

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,9 @@ private String makeCommand(String pomXml) {
103103

104104
if (isOSLinux()) {
105105
return StringUtil.format("/bin/bash -c mvn dependency:copy-dependencies -DoutputDirectory={} -DincludeScope=compile -f {}", libPath, pomXml);
106-
} else {
106+
} else if (isOSMac()){
107+
return StringUtil.format("mvn dependency:copy-dependencies -DoutputDirectory={} -DincludeScope=compile -f {}", libPath, pomXml);
108+
}else {
107109
return StringUtil.format("cmd /c mvn dependency:copy-dependencies -DoutputDirectory=lib -DincludeScope=compile -f {}", pomXml);
108110
}
109111
}
@@ -124,6 +126,23 @@ public static boolean isOSLinux() {
124126
}
125127
}
126128

129+
/**
130+
* judge if mac os.
131+
*
132+
* @return
133+
*/
134+
public static boolean isOSMac() {
135+
Properties prop = System.getProperties();
136+
137+
String os = prop.getProperty("os.name");
138+
if (os != null && os.toLowerCase().contains("mac")) {
139+
return true;
140+
} else {
141+
return false;
142+
}
143+
}
144+
145+
127146
public boolean isDone() {
128147
return done;
129148
}

0 commit comments

Comments
 (0)