Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ readme = "readme.md"
[dependencies]
arguably = "2.2.0"
edit = "0.1.4"
trash = "3.0.1"
rand = "0.8.5"
colored = "2.0"

[target.'cfg(not(target_os = "android"))'.dependencies]
trash = "3.0.1"
8 changes: 8 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -254,10 +254,17 @@ fn main() {
}

// Deletion loop. We haven't made any changes to the file system up to this point.
#[cfg(not(target_os = "android"))]
for input_file in delete_list {
delete_file(input_file, parser.found("quiet"));
}

#[cfg(target_os = "android")]
if !delete_list.is_empty() {
eprintln!("error: deletion not supported on Android")
}


// Rename loop.
for (input_file, output_file) in rename_list {
move_file(&input_file, &output_file, parser.found("quiet"));
Expand All @@ -283,6 +290,7 @@ fn get_temp_filename(base: &str) -> String {


// Move the specified file to the system's trash/recycle bin.
#[cfg(not(target_os = "android"))]
fn delete_file(input_file: &str, quiet: bool) {
if !quiet {
println!("{} {}", "Deleting".green().bold(), input_file);
Expand Down