Working fabric launcher

This commit is contained in:
2025-08-24 14:29:30 +02:00
parent 997cf37d31
commit 77280cd7d6
3 changed files with 12 additions and 12 deletions
+3 -1
View File
@@ -60,7 +60,9 @@ pub fn install_fabric(minecraft_path: &Path, minecraft_version: &str, loader_ver
let profile_json = profile_dir.join(format!("{profile_name}.json"));
let libs_dir = minecraft_path.join("libraries");
let json = query_meta_json(&format!("v2/versions/loader/{minecraft_version}/{loader_version}/profile/json"));
let mut json = query_meta_json(&format!("v2/versions/loader/{minecraft_version}/{loader_version}/profile/json"));
*json.get_mut("id").unwrap() = Value::String(profile_name.clone());
fs::create_dir_all(&profile_dir).unwrap();
+7
View File
@@ -34,3 +34,10 @@ pub fn launch_version(version: &str) {
)
.unwrap()
}
pub fn install_fabric(version: &str, loader: &str) {
let base_path = PathBuf::from(std::env::home_dir().unwrap()).join(".saturn-launcher");
let instances_path = base_path.join("instances");
let instance = instances_path.join(version);
fabric::install_fabric(&instance, version, loader).unwrap()
}
+2 -11
View File
@@ -1,14 +1,5 @@
use std::path::PathBuf;
fn main() {
// download_version("1.21.4");
// smallauncher_lib::download_version("1.21.4");
// smallauncher_lib::install_fabric("1.21.4", "0.17.2");
smallauncher_lib::launch_version("1.21.4");
// install_fabric("1.21.4", "0.17.2");
}
fn install_fabric(version: &str, loader: &str) {
let base_path = PathBuf::from(std::env::home_dir().unwrap()).join(".saturn-launcher");
let instances_path = base_path.join("instances");
let instance = instances_path.join(version);
smallauncher_lib::fabric::install_fabric(&instance, version, loader).unwrap()
}