From 4c31d9cb55a60881a84c81454c3f433b2c215809 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Wed, 26 Apr 2023 11:27:54 -0600 Subject: [PATCH] Add Redox support --- src/lib.rs | 9 ++++++++- src/redox.rs | 13 +++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 src/redox.rs diff --git a/src/lib.rs b/src/lib.rs index 4907263..ecce442 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -78,6 +78,9 @@ use ios as os; #[cfg(target_os = "haiku")] use haiku as os; +#[cfg(target_os = "redox")] +use redox as os; + #[cfg(any( target_os = "linux", target_os = "android", @@ -102,7 +105,8 @@ use unix as os; target_os = "ios", target_os = "macos", target_os = "windows", - target_os = "haiku" + target_os = "haiku", + target_os = "redox" )))] compile_error!("open is not supported on this platform"); @@ -270,6 +274,9 @@ mod ios; #[cfg(target_os = "haiku")] mod haiku; +#[cfg(target_os = "redox")] +mod redox; + #[cfg(any( target_os = "linux", target_os = "android", diff --git a/src/redox.rs b/src/redox.rs new file mode 100644 index 0000000..8fab343 --- /dev/null +++ b/src/redox.rs @@ -0,0 +1,13 @@ +use std::{ffi::OsStr, process::Command}; + +pub fn commands>(path: T) -> Vec { + let mut cmd = Command::new("/ui/bin/launcher"); + cmd.arg(path.as_ref()); + vec![cmd] +} + +pub fn with_command>(path: T, app: impl Into) -> Command { + let mut cmd = Command::new(app.into()); + cmd.arg(path.as_ref()); + cmd +}