yazi/yazi-plugin/src/utils/target.rs
2023-12-26 19:48:33 +08:00

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(())
}
}