From f829f8da72a1491d81defa269322d86812f1d3ac Mon Sep 17 00:00:00 2001 From: Coder-Huangzejia <3055859479@qq.com> Date: Thu, 12 Sep 2024 23:02:48 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E4=BA=86=E5=90=AF?= =?UTF-8?q?=E5=8A=A8agent=E6=9C=8D=E5=8A=A1=E6=A3=80=E6=B5=8B=E7=8E=AF?= =?UTF-8?q?=E5=A2=83=E6=97=B6=EF=BC=8C=E5=A6=82=E6=9E=9C=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E8=B7=AF=E5=BE=84=E6=88=96=E8=80=85=E7=9B=B8=E5=85=B3=E4=BE=9D?= =?UTF-8?q?=E8=B5=96=E8=B7=AF=E5=BE=84=E5=90=8D=E7=A7=B0=E5=AD=98=E5=9C=A8?= =?UTF-8?q?=E7=A9=BA=E6=A0=BC=E6=8A=A5=E9=94=99=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/org/cloud/sonic/agent/tools/EnvCheckTool.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/cloud/sonic/agent/tools/EnvCheckTool.java b/src/main/java/org/cloud/sonic/agent/tools/EnvCheckTool.java index 4b99e364..953abcde 100755 --- a/src/main/java/org/cloud/sonic/agent/tools/EnvCheckTool.java +++ b/src/main/java/org/cloud/sonic/agent/tools/EnvCheckTool.java @@ -136,7 +136,7 @@ private boolean checkADB() { adb.setExecutable(true); adb.setWritable(true); adb.setReadable(true); - List ver = ProcessCommandTool.getProcessLocalCommand(String.format("%s version", adb.getAbsolutePath())); + List 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 + " ." : "")); @@ -163,7 +163,7 @@ private boolean checkSAS() { sasBinary.setExecutable(true); sasBinary.setWritable(true); sasBinary.setReadable(true); - List ver = ProcessCommandTool.getProcessLocalCommand(String.format("%s version", sasBinary.getAbsolutePath())); + List 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); @@ -190,7 +190,7 @@ private boolean checkSIB() { sibBinary.setExecutable(true); sibBinary.setWritable(true); sibBinary.setReadable(true); - List ver = ProcessCommandTool.getProcessLocalCommand(String.format("%s version", sibBinary.getAbsolutePath())); + List 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); @@ -217,7 +217,7 @@ private boolean checkSGM() { sgmBinary.setExecutable(true); sgmBinary.setWritable(true); sgmBinary.setReadable(true); - List ver = ProcessCommandTool.getProcessLocalCommand(String.format("%s -version", sgmBinary.getAbsolutePath())); + List 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);