This commit is contained in:
sxyazi 2024-02-04 08:13:20 +08:00
parent e40e443cc1
commit c5f53bf74c
No known key found for this signature in database
3 changed files with 17 additions and 19 deletions

View file

@ -12,7 +12,7 @@ pub fn slim_lua() -> mlua::Result<Lua> {
crate::fs::install(&lua)?;
crate::process::install(&lua)?;
crate::utils::Utils::install(&lua)?;
crate::utils::install(&lua)?;
crate::Config::new(&lua).install_preview()?;
// Elements

View file

@ -10,7 +10,7 @@ pub fn init() {
crate::Loader::init();
crate::Config::new(lua).install_boot()?.install_manager()?.install_theme()?;
crate::utils::init();
crate::utils::pour(lua)?;
crate::utils::install(lua)?;
// Base
lua.load(include_str!("../preset/inspect/inspect.lua")).exec()?;

View file

@ -3,9 +3,8 @@ pub(super) static USERS_CACHE: yazi_shared::RoCell<uzers::UsersCache> = yazi_sha
pub(super) static HOSTNAME_CACHE: std::sync::OnceLock<Option<String>> = std::sync::OnceLock::new();
pub struct Utils;
pub(super) struct Utils;
impl Utils {
pub fn install(lua: &mlua::Lua) -> mlua::Result<()> {
let ya: mlua::Table = lua.create_table()?;
@ -23,7 +22,6 @@ impl Utils {
lua.globals().set("ya", ya)
}
}
pub fn init() {
#[cfg(unix)]