Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 修复了在启动agent服务检测环境时,如果项目路径或者相关依赖路径名称存在空格,则会报错的问题 #465

Merged
merged 1 commit into from
Sep 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/main/java/org/cloud/sonic/agent/tools/EnvCheckTool.java
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ private boolean checkADB() {
adb.setExecutable(true);
adb.setWritable(true);
adb.setReadable(true);
List<String> ver = ProcessCommandTool.getProcessLocalCommand(String.format("%s version", adb.getAbsolutePath()));
List<String> ver = ProcessCommandTool.getProcessLocalCommand(String.format("\"%s\" version", adb.getAbsolutePath()));
if (ver.size() == 0) {
printFail(type);
throw new RuntimeException("Can not use adb! Please ensure that `adb` command useful!" + (system.toUpperCase(Locale.ROOT).contains("MAC") ? " You can see " + HELP_URL + " ." : ""));
Expand All @@ -163,7 +163,7 @@ private boolean checkSAS() {
sasBinary.setExecutable(true);
sasBinary.setWritable(true);
sasBinary.setReadable(true);
List<String> ver = ProcessCommandTool.getProcessLocalCommand(String.format("%s version", sasBinary.getAbsolutePath()));
List<String> ver = ProcessCommandTool.getProcessLocalCommand(String.format("\"%s\" version", sasBinary.getAbsolutePath()));
sasPrintVersion = (ver.size() == 0 ? "null" : ver.get(0));
if (ver.size() == 0 || !BytesTool.versionCheck(sasVersion, ver.get(0))) {
printFail(type);
Expand All @@ -190,7 +190,7 @@ private boolean checkSIB() {
sibBinary.setExecutable(true);
sibBinary.setWritable(true);
sibBinary.setReadable(true);
List<String> ver = ProcessCommandTool.getProcessLocalCommand(String.format("%s version", sibBinary.getAbsolutePath()));
List<String> ver = ProcessCommandTool.getProcessLocalCommand(String.format("\"%s\" version", sibBinary.getAbsolutePath()));
sibPrintVersion = (ver.size() == 0 ? "null" : ver.get(0));
if (ver.size() == 0 || !BytesTool.versionCheck(sibVersion, ver.get(0))) {
printFail(type);
Expand All @@ -217,7 +217,7 @@ private boolean checkSGM() {
sgmBinary.setExecutable(true);
sgmBinary.setWritable(true);
sgmBinary.setReadable(true);
List<String> ver = ProcessCommandTool.getProcessLocalCommand(String.format("%s -version", sgmBinary.getAbsolutePath()));
List<String> ver = ProcessCommandTool.getProcessLocalCommand(String.format("\"%s\" -version", sgmBinary.getAbsolutePath()));
sgmPrintVersion = (ver.size() == 0 ? "null" : ver.get(0));
if (ver.size() == 0 || !BytesTool.versionCheck(sgmVersion, ver.get(0).replace("sonic-go-mitmproxy:", "").trim())) {
printFail(type);
Expand Down
Loading