File tree Expand file tree Collapse file tree 1 file changed +14
-5
lines changed
Expand file tree Collapse file tree 1 file changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -262,11 +262,20 @@ All the contents from the trash more then {days} days will be deleted permanentl
262262
263263 if ignore {
264264 // not need of seperate function for this
265- if let Err ( e) = fs:: remove_dir_all ( & path) {
266- eprintln ! (
267- "{}" ,
268- format!( "Error deleting with out moving to trash: {e}" ) . red( )
269- )
265+ if path. is_dir ( ) {
266+ if let Err ( e) = fs:: remove_dir_all ( & path) {
267+ eprintln ! (
268+ "{}" ,
269+ format!( "Error deleting with out moving to trash: {e}" ) . red( )
270+ )
271+ }
272+ } else if path. is_file ( ) {
273+ if let Err ( e) = fs:: remove_file ( & path) {
274+ eprintln ! (
275+ "{}" ,
276+ format!( "Error deleting with out moving to trash: {e}" ) . red( )
277+ )
278+ }
270279 }
271280 } else if let Err ( e) = delete ( & path) {
272281 eprintln ! ( "{}" , format!( "Error moving to trash: {e}" ) . red( ) ) ;
You can’t perform that action at this time.
0 commit comments