mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
feat: make trash optional (#178)
This commit is contained in:
parent
db4d5edeb4
commit
6d2f69b612
3 changed files with 6 additions and 2 deletions
|
|
@ -26,9 +26,11 @@ syntect = "^5"
|
||||||
tokio = { version = "^1", features = [ "parking_lot", "macros", "rt-multi-thread", "sync", "time", "fs", "process", "io-std", "io-util" ] }
|
tokio = { version = "^1", features = [ "parking_lot", "macros", "rt-multi-thread", "sync", "time", "fs", "process", "io-std", "io-util" ] }
|
||||||
tokio-stream = "^0"
|
tokio-stream = "^0"
|
||||||
tracing = "^0"
|
tracing = "^0"
|
||||||
trash = "^3"
|
|
||||||
unicode-width = "^0"
|
unicode-width = "^0"
|
||||||
yazi-prebuild = "^0"
|
yazi-prebuild = "^0"
|
||||||
|
|
||||||
[target.'cfg(target_os = "windows")'.dependencies]
|
[target.'cfg(target_os = "windows")'.dependencies]
|
||||||
clipboard-win = "^4"
|
clipboard-win = "^4"
|
||||||
|
|
||||||
|
[target.'cfg(not(target_os = "netbsd"))'.dependencies]
|
||||||
|
trash = "^3"
|
||||||
|
|
|
||||||
|
|
@ -159,7 +159,7 @@ impl File {
|
||||||
ctx.set_delete_method(DeleteMethod::NsFileManager);
|
ctx.set_delete_method(DeleteMethod::NsFileManager);
|
||||||
ctx.delete(&task.target)?;
|
ctx.delete(&task.target)?;
|
||||||
}
|
}
|
||||||
#[cfg(not(target_os = "macos"))]
|
#[cfg(not(target_os = "netbsd"))]
|
||||||
{
|
{
|
||||||
trash::delete(&task.target)?;
|
trash::delete(&task.target)?;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -101,6 +101,8 @@ pub fn file_mode(mode: u32) -> String {
|
||||||
let m = mode as u16;
|
let m = mode as u16;
|
||||||
#[cfg(target_os = "freebsd")]
|
#[cfg(target_os = "freebsd")]
|
||||||
let m = mode as u16;
|
let m = mode as u16;
|
||||||
|
#[cfg(target_os = "netbsd")]
|
||||||
|
let m = mode;
|
||||||
#[cfg(target_os = "linux")]
|
#[cfg(target_os = "linux")]
|
||||||
let m = mode;
|
let m = mode;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue