aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeckoEidechse <gecko.eidechse+git@pm.me>2023-07-18 01:31:20 +0200
committerGeckoEidechse <gecko.eidechse+git@pm.me>2023-07-18 01:31:20 +0200
commit0fc68de30150746721be31728e84f86434086bc7 (patch)
tree1416bf5df0718c4a1457198caff4bf886dd9106c
parent7e301bdede6b31e752c82390d219d1a363a6d504 (diff)
downloadFlightCore-0fc68de30150746721be31728e84f86434086bc7.tar.gz
FlightCore-0fc68de30150746721be31728e84f86434086bc7.zip
fix: Formatting
-rw-r--r--src-tauri/src/mod_management/mod.rs16
1 files changed, 11 insertions, 5 deletions
diff --git a/src-tauri/src/mod_management/mod.rs b/src-tauri/src/mod_management/mod.rs
index 864f5448..d0ce3476 100644
--- a/src-tauri/src/mod_management/mod.rs
+++ b/src-tauri/src/mod_management/mod.rs
@@ -557,7 +557,10 @@ fn delete_package_folder(ts_package_directory: &str) -> Result<(), String> {
let mod_json_path = ns_mod_dir_path.join("manifest.json");
if !mod_json_path.exists() {
// If it doesn't exist, return an error
- return Err(format!("manifest.json does not exist in {}", ts_package_directory));
+ return Err(format!(
+ "manifest.json does not exist in {}",
+ ts_package_directory
+ ));
}
match std::fs::remove_dir_all(ts_package_directory) {
@@ -575,14 +578,17 @@ pub fn delete_thunderstore_mod(
// Check packages
let packages_folder = format!("{}/R2Northstar/packages", game_install.game_path);
if std::path::Path::new(&packages_folder).exists() {
- println!("Directory {} exists. Listing subdirectories...", packages_folder);
+ println!(
+ "Directory {} exists. Listing subdirectories...",
+ packages_folder
+ );
for entry in fs::read_dir(packages_folder).unwrap() {
let entry = entry.unwrap();
-
+
// Check if it's a folder and skip if otherwise
if !entry.file_type().unwrap().is_dir() {
log::warn!("Skipping \"{}\", not a file", entry.path().display());
- continue;
+ continue;
}
let entry_path = entry.path();
@@ -593,7 +599,7 @@ pub fn delete_thunderstore_mod(
// Not the mod folder we are looking for, try the next one\
continue;
}
-
+
// All checks passed, this is the matching mod
return delete_package_folder(&entry.path().display().to_string());
}