remove empty resources in case of dry launch

This commit is contained in:
SpikeHD
2022-06-05 21:15:50 -07:00
parent 04a29ce567
commit c1b5256a5b
5 changed files with 11 additions and 12 deletions

View File

@@ -27,4 +27,9 @@ pub fn dir_exists(path: &str) -> bool {
#[tauri::command]
pub fn dir_is_empty(path: &str) -> bool {
return fs::read_dir(&path).unwrap().count() == 0;
}
#[tauri::command]
pub fn dir_delete(path: &str) {
fs::remove_dir_all(path).unwrap();
}

View File

@@ -59,6 +59,7 @@ fn main() {
file_helpers::rename,
file_helpers::dir_exists,
file_helpers::dir_is_empty,
file_helpers::dir_delete,
downloader::download_file,
downloader::stop_download,
lang::get_lang,