From 49ae3d8e70d82a463afb70f98fa310f61e545915 Mon Sep 17 00:00:00 2001 From: GreasySlug <9619abgoni@gmail.com> Date: Sat, 13 Aug 2022 17:47:27 +0900 Subject: [PATCH] fix: use `where` instead of 'which' in windows --- compiler/erg_common/python_util.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/compiler/erg_common/python_util.rs b/compiler/erg_common/python_util.rs index 95ad997d..a375120b 100644 --- a/compiler/erg_common/python_util.rs +++ b/compiler/erg_common/python_util.rs @@ -6,11 +6,11 @@ use std::process::Command; use crate::serialize::get_magic_num_from_bytes; pub fn which_python() -> String { - let python = if cfg!(windows) { "python" } else { "python3" }; - let out = Command::new("which") - .arg(python) - .output() - .expect("python not found"); + let (cmd, python) = if cfg!(windows) { ("where", "python") } else { ("which", "python3") }; + let out = Command::new(cmd) + .arg(python) + .output() + .expect("python not found"); let res = String::from_utf8(out.stdout) .unwrap() .replace('\n', "")