mirror of
https://github.com/erg-lang/erg.git
synced 2025-09-29 12:24:45 +00:00
fix: use where
instead of 'which' in windows
This commit is contained in:
parent
9e9754de7f
commit
49ae3d8e70
1 changed files with 5 additions and 5 deletions
|
@ -6,8 +6,8 @@ use std::process::Command;
|
||||||
use crate::serialize::get_magic_num_from_bytes;
|
use crate::serialize::get_magic_num_from_bytes;
|
||||||
|
|
||||||
pub fn which_python() -> String {
|
pub fn which_python() -> String {
|
||||||
let python = if cfg!(windows) { "python" } else { "python3" };
|
let (cmd, python) = if cfg!(windows) { ("where", "python") } else { ("which", "python3") };
|
||||||
let out = Command::new("which")
|
let out = Command::new(cmd)
|
||||||
.arg(python)
|
.arg(python)
|
||||||
.output()
|
.output()
|
||||||
.expect("python not found");
|
.expect("python not found");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue