Skip to content

Commit 4c31d9c

Browse files
committed
Add Redox support
1 parent b076fc4 commit 4c31d9c

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

src/lib.rs

+8-1
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ use ios as os;
7878
#[cfg(target_os = "haiku")]
7979
use haiku as os;
8080

81+
#[cfg(target_os = "redox")]
82+
use redox as os;
83+
8184
#[cfg(any(
8285
target_os = "linux",
8386
target_os = "android",
@@ -102,7 +105,8 @@ use unix as os;
102105
target_os = "ios",
103106
target_os = "macos",
104107
target_os = "windows",
105-
target_os = "haiku"
108+
target_os = "haiku",
109+
target_os = "redox"
106110
)))]
107111
compile_error!("open is not supported on this platform");
108112

@@ -270,6 +274,9 @@ mod ios;
270274
#[cfg(target_os = "haiku")]
271275
mod haiku;
272276

277+
#[cfg(target_os = "redox")]
278+
mod redox;
279+
273280
#[cfg(any(
274281
target_os = "linux",
275282
target_os = "android",

src/redox.rs

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
use std::{ffi::OsStr, process::Command};
2+
3+
pub fn commands<T: AsRef<OsStr>>(path: T) -> Vec<Command> {
4+
let mut cmd = Command::new("/ui/bin/launcher");
5+
cmd.arg(path.as_ref());
6+
vec![cmd]
7+
}
8+
9+
pub fn with_command<T: AsRef<OsStr>>(path: T, app: impl Into<String>) -> Command {
10+
let mut cmd = Command::new(app.into());
11+
cmd.arg(path.as_ref());
12+
cmd
13+
}

0 commit comments

Comments
 (0)