@@ -14,6 +14,7 @@ pub trait ClipboardProvider: std::fmt::Debug {
14 fn set_contents(&mut self, contents: String, clipboard_type: ClipboardType) -> Result<()>;
14 fn set_contents(&mut self, contents: String, clipboard_type: ClipboardType) -> Result<()>;
17macro_rules! command_provider {
18macro_rules! command_provider {
18 (paste => $get_prg:literal $( , $get_arg:literal )* ; copy => $set_prg:literal $( , $set_arg:literal )* ; ) => {{
19 (paste => $get_prg:literal $( , $get_arg:literal )* ; copy => $set_prg:literal $( , $set_arg:literal )* ; ) => {{
19 Box::new(provider::command::Provider {
20 Box::new(provider::command::Provider {
@@ -212,14 +213,17 @@ mod provider {
212 use super::*;
213 use super::*;
213 use anyhow::{bail, Context as _, Result};
214 use anyhow::{bail, Context as _, Result};
216+ #[cfg(not(windows))]
215 pub fn exists(executable_name: &str) -> bool {
217 pub fn exists(executable_name: &str) -> bool {
216 which::which(executable_name).is_ok()
218 which::which(executable_name).is_ok()
221+ #[cfg(not(any(windows, target_os = "macos")))]
219 pub fn env_var_is_set(env_var_name: &str) -> bool {
222 pub fn env_var_is_set(env_var_name: &str) -> bool {
220 std::env::var_os(env_var_name).is_some()
223 std::env::var_os(env_var_name).is_some()
226+ #[cfg(not(any(windows, target_os = "macos")))]
223 pub fn is_exit_success(program: &str, args: &[&str]) -> bool {
227 pub fn is_exit_success(program: &str, args: &[&str]) -> bool {
224 std::process::Command::new(program)
228 std::process::Command::new(program)
225 .args(args)
229 .args(args)