From 31e0d351e2042b263dfd5263ffbbe71c091210c1 Mon Sep 17 00:00:00 2001 From: Jonathan Anderson Date: Thu, 5 Sep 2024 11:39:54 -0230 Subject: [PATCH] Generalize OS detection. There are many Unix-like OSes that have xdg-open that are not Linux. Rather than enumerating DragonflyBSD, FreeBSD, NetBSD, OpenBSD, etc., change this "Linux" target to "Unix and not Android and not MacOS". --- plotly/src/plot.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plotly/src/plot.rs b/plotly/src/plot.rs index cf27f9c..716fa78 100644 --- a/plotly/src/plot.rs +++ b/plotly/src/plot.rs @@ -464,7 +464,7 @@ impl Plot { .expect("Invalid JSON structure - expected a top-level Object") } - #[cfg(target_os = "linux")] + #[cfg(all(unix, not(target_os = "android"), not(target_os = "macos")))] fn show_with_default_app(temp_path: &str) { use std::process::Command; Command::new("xdg-open")