Working fabric launcher
This commit is contained in:
+3
-1
@@ -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 profile_json = profile_dir.join(format!("{profile_name}.json"));
|
||||||
let libs_dir = minecraft_path.join("libraries");
|
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();
|
fs::create_dir_all(&profile_dir).unwrap();
|
||||||
|
|
||||||
|
|||||||
@@ -34,3 +34,10 @@ pub fn launch_version(version: &str) {
|
|||||||
)
|
)
|
||||||
.unwrap()
|
.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
@@ -1,14 +1,5 @@
|
|||||||
use std::path::PathBuf;
|
|
||||||
|
|
||||||
fn main() {
|
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");
|
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()
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user