Skip to content

Commit e7930ca

Browse files
committed
[rust] Run PS command to discover OS
1 parent 0e32276 commit e7930ca

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

rust/src/config.rs

Lines changed: 3 additions & 3 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, ENV_PROCESSOR_ARCHITECTURE,
2222
REQUEST_TIMEOUT_SEC, UNAME_COMMAND,
@@ -71,8 +71,8 @@ impl ManagerConfig {
7171
let self_arch = if WINDOWS.is(self_os) {
7272
let mut architecture = env::var(ENV_PROCESSOR_ARCHITECTURE).unwrap_or_default();
7373
if architecture.is_empty() {
74-
let get_os_command = Command::new_single(WMIC_COMMAND_OS.to_string());
75-
architecture = run_shell_command_by_os(self_os, get_os_command).unwrap_or_default();
74+
let get_os_command = Command::new_single(PS_GET_OS_COMMAND.to_string());
75+
architecture = run_powershell_command(get_os_command).unwrap_or_default();
7676
}
7777
if architecture.contains("32") {
7878
ARCH_X86.to_string()

0 commit comments

Comments
 (0)