crossbundle_tools/commands/android/common/helper_functions.rs
1use crate::error::*;
2
3/// Helper function to delete files
4pub fn remove(target: Vec<std::path::PathBuf>) -> Result<()> {
5 target.iter().for_each(|content| {
6 if content.exists() && content.is_file() {
7 std::fs::remove_file(content).unwrap();
8 }
9 if content.exists() && content.is_dir() {
10 std::fs::remove_dir_all(content).unwrap();
11 }
12 });
13 Ok(())
14}