diff --git a/crates/client/src/views/add_profile_menu.rs b/crates/client/src/views/add_profile_menu.rs index 334ee9b..a660646 100644 --- a/crates/client/src/views/add_profile_menu.rs +++ b/crates/client/src/views/add_profile_menu.rs @@ -70,6 +70,7 @@ impl View for AddProfileMenu<'_> { && match selected_loader { Loader::Fabric { version } => func(version.as_ref()), Loader::Vanilla => unreachable!(), + Loader::Forge => unreachable!(), } } diff --git a/crates/nomi-core/src/instance/launch.rs b/crates/nomi-core/src/instance/launch.rs index 4db79ad..ba73dd1 100644 --- a/crates/nomi-core/src/instance/launch.rs +++ b/crates/nomi-core/src/instance/launch.rs @@ -18,7 +18,7 @@ use crate::{ markers::Undefined, repository::{ java_runner::JavaRunner, - manifest::{Arguments, Manifest, VersionType}, + manifest::{Manifest, VersionType}, }, }; diff --git a/crates/nomi-core/src/loaders/forge.rs b/crates/nomi-core/src/loaders/forge.rs index d6ff0b2..f0a29a9 100644 --- a/crates/nomi-core/src/loaders/forge.rs +++ b/crates/nomi-core/src/loaders/forge.rs @@ -1,21 +1,15 @@ use std::{ - borrow::Cow, collections::HashMap, fmt::Debug, fs::File, io::{BufRead, Read}, - marker::PhantomData, path::{Path, PathBuf}, - slice::Iter, }; use anyhow::{anyhow, bail}; use itertools::Itertools; use serde::{de::DeserializeOwned, Deserialize, Serialize}; -use tokio::{ - io::{AsyncWriteExt, BufReader}, - process::Command, -}; +use tokio::{io::AsyncWriteExt, process::Command}; use tracing::{error, info, warn}; use zip::read::ZipFile; @@ -24,13 +18,12 @@ use crate::{ downloads::{ download_file, progress::ProgressSender, - traits::{DownloadResult, DownloadStatus, Downloader}, + traits::{DownloadResult, Downloader}, DownloadQueue, FileDownloader, LibrariesDownloader, LibrariesMapper, }, game_paths::GamePaths, instance::{launch::CLASSPATH_SEPARATOR, profile::LoaderProfile}, loaders::vanilla::VanillaLibrariesMapper, - markers::Undefined, maven_data::{MavenArtifact, MavenData}, repository::{ java_runner::JavaRunner, @@ -38,13 +31,12 @@ use crate::{ simple_args::SimpleArgs, simple_lib::SimpleLib, }, - utils::path_to_string, PinnedFutureWithBounds, DOT_NOMI_TEMP_DIR, }; const FORGE_REPO_URL: &str = "https://maven.minecraftforge.net"; -const NEO_FORGE_REPO_URL: &str = "https://maven.neoforged.net/releases/"; +const _NEO_FORGE_REPO_URL: &str = "https://maven.neoforged.net/releases/"; /// Some versions require to have a suffix const FORGE_SUFFIXES: &[(&str, &[&str])] = &[ @@ -370,6 +362,14 @@ impl Downloader for Forge { .await?; } + // Remove temporary files + if let Some(binpatch_dir) = forge_binpatch_path(&game_version, &forge_version).parent() { + tokio::fs::remove_dir_all(binpatch_dir).await?; + }; + + let forge_installer = forge_installer_path(&game_version, &forge_version); + tokio::fs::remove_file(forge_installer).await?; + Ok(()) } diff --git a/crates/nomi-core/src/maven_data.rs b/crates/nomi-core/src/maven_data.rs index da875d1..6af9ef6 100644 --- a/crates/nomi-core/src/maven_data.rs +++ b/crates/nomi-core/src/maven_data.rs @@ -3,7 +3,7 @@ use std::{fmt::Display, path::PathBuf}; use itertools::Itertools; use regex::Regex; use serde::{Deserialize, Serialize}; -use tracing::{error, warn}; +use tracing::error; #[derive(Debug, Default)] pub struct MavenData { @@ -111,7 +111,7 @@ mod tests { fn maven_artifact_parse_test() { let artifact = MavenArtifact::new("de.oceanlabs.mcp:mcp_config:1.20.1-20230612.114412@zip"); - println!("{:#?}", artifact); + println!("{artifact:#?}"); } #[test] diff --git a/crates/nomi-core/tests/forge_new_test.rs b/crates/nomi-core/tests/forge_new_test.rs index c1baa10..8ce2682 100644 --- a/crates/nomi-core/tests/forge_new_test.rs +++ b/crates/nomi-core/tests/forge_new_test.rs @@ -2,7 +2,6 @@ use std::path::PathBuf; use nomi_core::{ configs::profile::{ProfileState, VersionProfile}, - downloads::traits::Downloader, game_paths::GamePaths, instance::{ launch::{arguments::UserData, LaunchSettings}, diff --git a/crates/nomi-core/tests/forge_old_test.rs b/crates/nomi-core/tests/forge_old_test.rs index 0b6a396..76dc734 100644 --- a/crates/nomi-core/tests/forge_old_test.rs +++ b/crates/nomi-core/tests/forge_old_test.rs @@ -9,10 +9,7 @@ use nomi_core::{ logs::PrintLogs, Instance, }, - loaders::{ - forge::{Forge, ForgeVersion}, - vanilla::Vanilla, - }, + loaders::forge::{Forge, ForgeVersion}, repository::java_runner::JavaRunner, MINECRAFT_DIR, };