mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-24 08:11:04 +00:00
27 lines
357 B
Rust
27 lines
357 B
Rust
use mlua::{Lua, Table};
|
|
|
|
use super::Utils;
|
|
|
|
impl Utils {
|
|
pub(super) fn target(lua: &Lua, ya: &Table) -> mlua::Result<()> {
|
|
ya.set(
|
|
"target_family",
|
|
lua.create_function(|_, ()| {
|
|
#[cfg(unix)]
|
|
{
|
|
Ok("unix")
|
|
}
|
|
#[cfg(windows)]
|
|
{
|
|
Ok("windows")
|
|
}
|
|
#[cfg(wasm)]
|
|
{
|
|
Ok("wasm")
|
|
}
|
|
})?,
|
|
)?;
|
|
|
|
Ok(())
|
|
}
|
|
}
|