Skip to content

Commit

Permalink
feat: make trash optional (#178)
Browse files Browse the repository at this point in the history
  • Loading branch information
sxyazi authored Sep 19, 2023
1 parent db4d5ed commit 6d2f69b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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-stream = "^0"
tracing = "^0"
trash = "^3"
unicode-width = "^0"
yazi-prebuild = "^0"

[target.'cfg(target_os = "windows")'.dependencies]
clipboard-win = "^4"

[target.'cfg(not(target_os = "netbsd"))'.dependencies]
trash = "^3"
2 changes: 1 addition & 1 deletion core/src/tasks/workers/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ impl File {
ctx.set_delete_method(DeleteMethod::NsFileManager);
ctx.delete(&task.target)?;
}
#[cfg(not(target_os = "macos"))]
#[cfg(not(target_os = "netbsd"))]
{
trash::delete(&task.target)?;
}
Expand Down
2 changes: 2 additions & 0 deletions shared/src/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ pub fn file_mode(mode: u32) -> String {
let m = mode as u16;
#[cfg(target_os = "freebsd")]
let m = mode as u16;
#[cfg(target_os = "netbsd")]
let m = mode;
#[cfg(target_os = "linux")]
let m = mode;

Expand Down

0 comments on commit 6d2f69b

Please sign in to comment.