diff --git a/yazi-cli/src/package/git.rs b/yazi-cli/src/package/git.rs index 58004792..ab6d97d9 100644 --- a/yazi-cli/src/package/git.rs +++ b/yazi-cli/src/package/git.rs @@ -16,7 +16,7 @@ impl Git { } pub(super) async fn checkout(path: &Path, rev: &str) -> Result<()> { - Self::exec(|c| c.args(["checkout", rev]).current_dir(path)).await + Self::exec(|c| c.args(["checkout", rev, "--force"]).current_dir(path)).await } pub(super) async fn pull(path: &Path) -> Result<()> { diff --git a/yazi-config/src/lib.rs b/yazi-config/src/lib.rs index 8107b79a..1d3ff20e 100644 --- a/yazi-config/src/lib.rs +++ b/yazi-config/src/lib.rs @@ -1,6 +1,6 @@ #![allow(clippy::module_inception)] -yazi_macro::mod_pub!(keymap mgr open opener plugin popup preview scheme tasks theme which); +yazi_macro::mod_pub!(keymap mgr open opener plugin popup preview tasks theme vfs which); yazi_macro::mod_flat!(color icon layout pattern platform preset priority style yazi); diff --git a/yazi-config/src/scheme/mod.rs b/yazi-config/src/vfs/mod.rs similarity index 100% rename from yazi-config/src/scheme/mod.rs rename to yazi-config/src/vfs/mod.rs diff --git a/yazi-config/src/scheme/sftp.rs b/yazi-config/src/vfs/sftp.rs similarity index 100% rename from yazi-config/src/scheme/sftp.rs rename to yazi-config/src/vfs/sftp.rs diff --git a/yazi-fs/src/provider/mod.rs b/yazi-fs/src/provider/mod.rs index c1d7908e..ce56650e 100644 --- a/yazi-fs/src/provider/mod.rs +++ b/yazi-fs/src/provider/mod.rs @@ -1,3 +1,3 @@ -yazi_macro::mod_pub!(local); +yazi_macro::mod_pub!(local sftp); yazi_macro::mod_flat!(buffer dir_entry provider read_dir rw_file); diff --git a/yazi-fs/src/provider/sftp/mod.rs b/yazi-fs/src/provider/sftp/mod.rs new file mode 100644 index 00000000..330ec80f --- /dev/null +++ b/yazi-fs/src/provider/sftp/mod.rs @@ -0,0 +1 @@ +yazi_macro::mod_flat!(sftp); diff --git a/yazi-fs/src/provider/sftp/sftp.rs b/yazi-fs/src/provider/sftp/sftp.rs new file mode 100644 index 00000000..6732e35a --- /dev/null +++ b/yazi-fs/src/provider/sftp/sftp.rs @@ -0,0 +1,190 @@ +use std::{io, path::{Path, PathBuf}}; + +use crate::cha::Cha; + +pub struct Sftp; + +impl Sftp { + pub fn cache
(_: P) -> Option (path: P) -> io::Result (from: P, to: Q, cha: Cha) -> io::Result (path: P) -> io::Result<()>
+ where
+ P: AsRef (path: P) -> io::Result<()>
+ where
+ P: AsRef (path: P) -> io::Result<()>
+ where
+ P: AsRef (original: P, link: Q) -> io::Result<()>
+ where
+ P: AsRef (path: P) -> io::Result (path: P) -> io::Result<()>
+ where
+ P: AsRef (path: P) -> io::Result (path: P) -> io::Result<()>
+ where
+ P: AsRef (path: P) -> io::Result<()>
+ where
+ P: AsRef (path: P) -> io::Result (path: P) -> io::Result (path: P) -> io::Result<()>
+ where
+ P: AsRef (path: P) -> io::Result<()>
+ where
+ P: AsRef (path: P) -> io::Result<()>
+ where
+ P: AsRef (from: P, to: Q) -> io::Result<()>
+ where
+ P: AsRef (original: P, link: Q, _is_dir: F) -> io::Result<()>
+ where
+ P: AsRef (original: P, link: Q) -> io::Result<()>
+ where
+ P: AsRef (original: P, link: Q) -> io::Result<()>
+ where
+ P: AsRef (path: P) -> io::Result (path: P) -> io::Result (path: P) -> io::Result<()>
+ where
+ P: AsRef (path: P, contents: C) -> io::Result<()>
+ where
+ P: AsRef