Skip to content

Commit a56ac18

Browse files
committed
[rust] Run PS command to discover OS
1 parent 9086155 commit a56ac18

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

rust/src/config.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
// under the License.
1717

1818
use crate::config::OS::{LINUX, MACOS, WINDOWS};
19-
use crate::shell::run_shell_command_by_os;
19+
use crate::shell::{run_powershell_command, run_shell_command_by_os};
2020
use crate::{
2121
default_cache_folder, format_one_arg, path_to_string, Command, REQUEST_TIMEOUT_SEC,
2222
UNAME_COMMAND,
@@ -70,10 +70,10 @@ impl ManagerConfig {
7070
let self_os = OS;
7171
let self_arch = if WINDOWS.is(self_os) {
7272
let get_os_command = Command::new_single(PS_GET_OS_COMMAND.to_string());
73-
let ps_output = run_shell_command_by_os(self_os, get_os_command).unwrap_or_default();
74-
if ps_output.contains("32") {
73+
let output = run_powershell_command(get_os_command).unwrap_or_default();
74+
if output.contains("32") {
7575
ARCH_X86.to_string()
76-
} else if ps_output.contains("ARM") {
76+
} else if output.contains("ARM") {
7777
ARCH_ARM64.to_string()
7878
} else {
7979
ARCH_AMD64.to_string()

0 commit comments

Comments
 (0)