mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
feat: make trash optional
This commit is contained in:
parent
c540542da4
commit
2447917ac7
2 changed files with 17 additions and 10 deletions
|
|
@ -26,9 +26,13 @@ syntect = "^5"
|
|||
tokio = { version = "^1", features = [ "parking_lot", "macros", "rt-multi-thread", "sync", "time", "fs", "process", "io-std", "io-util" ] }
|
||||
tokio-stream = "^0"
|
||||
tracing = "^0"
|
||||
trash = "^3"
|
||||
trash = { version = "^3", optional = true }
|
||||
unicode-width = "^0"
|
||||
yazi-prebuild = "^0"
|
||||
|
||||
[target.'cfg(target_os = "windows")'.dependencies]
|
||||
clipboard-win = "^4"
|
||||
|
||||
[features]
|
||||
trash_bin = [ "trash" ]
|
||||
default = [ "trash_bin" ]
|
||||
|
|
|
|||
|
|
@ -152,6 +152,8 @@ impl File {
|
|||
self.sch.send(TaskOp::Adv(task.id, 1, task.length))?
|
||||
}
|
||||
FileOp::Trash(task) => {
|
||||
#[cfg(feature = "trash_bin")]
|
||||
{
|
||||
#[cfg(target_os = "macos")]
|
||||
{
|
||||
use trash::{macos::{DeleteMethod, TrashContextExtMacos}, TrashContext};
|
||||
|
|
@ -163,6 +165,7 @@ impl File {
|
|||
{
|
||||
trash::delete(&task.target)?;
|
||||
}
|
||||
}
|
||||
self.sch.send(TaskOp::Adv(task.id, 1, task.length))?;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue