mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
Fix Windows again
This commit is contained in:
parent
5328747009
commit
b13a2a19ff
1 changed files with 5 additions and 3 deletions
|
|
@ -1,14 +1,16 @@
|
||||||
use mlua::{Lua, Table};
|
use mlua::{Lua, Table};
|
||||||
use uzers::{Groups, Users, UsersCache};
|
|
||||||
use yazi_shared::RoCell;
|
use yazi_shared::RoCell;
|
||||||
|
|
||||||
use super::Utils;
|
use super::Utils;
|
||||||
|
|
||||||
static CACHE: RoCell<UsersCache> = RoCell::new();
|
|
||||||
|
|
||||||
impl Utils {
|
impl Utils {
|
||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
pub(super) fn user(lua: &Lua, ya: &Table) -> mlua::Result<()> {
|
pub(super) fn user(lua: &Lua, ya: &Table) -> mlua::Result<()> {
|
||||||
|
#[cfg(unix)]
|
||||||
|
use uzers::{Groups, Users, UsersCache};
|
||||||
|
#[cfg(unix)]
|
||||||
|
static CACHE: RoCell<UsersCache> = RoCell::new();
|
||||||
|
|
||||||
CACHE.with(Default::default);
|
CACHE.with(Default::default);
|
||||||
|
|
||||||
ya.set("uid", lua.create_function(|_, ()| Ok(CACHE.get_current_uid()))?)?;
|
ya.set("uid", lua.create_function(|_, ()| Ok(CACHE.get_current_uid()))?)?;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue