Skip to content

Commit

Permalink
feat: Add Redox support. (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
Byron committed Apr 26, 2023
2 parents b076fc4 + 4c31d9c commit b8089a6
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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");

Expand Down Expand Up @@ -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",
Expand Down
13 changes: 13 additions & 0 deletions src/redox.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
use std::{ffi::OsStr, process::Command};

pub fn commands<T: AsRef<OsStr>>(path: T) -> Vec<Command> {
let mut cmd = Command::new("/ui/bin/launcher");
cmd.arg(path.as_ref());
vec![cmd]
}

pub fn with_command<T: AsRef<OsStr>>(path: T, app: impl Into<String>) -> Command {
let mut cmd = Command::new(app.into());
cmd.arg(path.as_ref());
cmd
}

0 comments on commit b8089a6

Please sign in to comment.