mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
parent
84d71bfa39
commit
b04e8382d0
1 changed files with 23 additions and 14 deletions
|
|
@ -20,7 +20,9 @@ impl Deref for Loader {
|
|||
type Target = RwLock<HashMap<String, Chunk>>;
|
||||
|
||||
#[inline]
|
||||
fn deref(&self) -> &Self::Target { &self.cache }
|
||||
fn deref(&self) -> &Self::Target {
|
||||
&self.cache
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for Loader {
|
||||
|
|
@ -61,6 +63,13 @@ impl Loader {
|
|||
Ok(b) => b,
|
||||
Err(e) if e.kind() == std::io::ErrorKind::NotFound => {
|
||||
static WARNED: std::sync::atomic::AtomicBool = std::sync::atomic::AtomicBool::new(false);
|
||||
|
||||
let p = BOOT.plugin_dir.join(format!("{name}.yazi/init.lua"));
|
||||
|
||||
match fs::read(&p).await {
|
||||
Err(e) => Err(e).with_context(|| format!("Failed to load plugin from {p:?}"))?,
|
||||
|
||||
Ok(b) => {
|
||||
if !WARNED.swap(true, std::sync::atomic::Ordering::Relaxed) {
|
||||
yazi_proxy::AppProxy::notify(yazi_proxy::options::NotifyOpt {
|
||||
title: "Deprecated entry file".to_owned(),
|
||||
|
|
@ -73,9 +82,9 @@ Please run `ya pack -m` to automatically migrate all plugins, or manually rename
|
|||
timeout: std::time::Duration::from_secs(25),
|
||||
});
|
||||
}
|
||||
|
||||
let p = BOOT.plugin_dir.join(format!("{name}.yazi/init.lua"));
|
||||
fs::read(&p).await.with_context(|| format!("Failed to load plugin from {p:?}"))?
|
||||
b
|
||||
}
|
||||
}
|
||||
}
|
||||
Err(e) => Err(e).with_context(|| format!("Failed to load plugin from {p:?}"))?,
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue