Fix compilation on windows

This commit is contained in:
Blaž Hrastnik 2022-08-22 10:17:09 +09:00
parent cb7615e0ed
commit e863f6fe27
No known key found for this signature in database
GPG Key ID: 1238B9C4AD889640

View File

@ -231,12 +231,11 @@ pub mod command {
use super::*; use super::*;
use anyhow::{bail, Context as _, Result}; use anyhow::{bail, Context as _, Result};
#[cfg(not(windows))]
pub fn exists(executable_name: &str) -> bool { pub fn exists(executable_name: &str) -> bool {
which::which(executable_name).is_ok() which::which(executable_name).is_ok()
} }
#[cfg(not(any(windows, target_os = "macos")))] #[cfg(not(windows))]
pub fn env_var_is_set(env_var_name: &str) -> bool { pub fn env_var_is_set(env_var_name: &str) -> bool {
std::env::var_os(env_var_name).is_some() std::env::var_os(env_var_name).is_some()
} }