summaryrefslogtreecommitdiffstats
path: root/ozone-cli/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'ozone-cli/src/main.rs')
-rw-r--r--ozone-cli/src/main.rs19
1 files changed, 10 insertions, 9 deletions
diff --git a/ozone-cli/src/main.rs b/ozone-cli/src/main.rs
index 965d27f..bb72ce3 100644
--- a/ozone-cli/src/main.rs
+++ b/ozone-cli/src/main.rs
@@ -3,7 +3,7 @@ use std::error::Error;
use std::path::PathBuf;
use log::{error, info};
use sysinfo::System;
-use o3launcher::launcher::Profile;
+use o3launcher::launcher::{Launcher, Settings};
#[tokio::main]
async fn main() -> Result<(), Box<dyn Error>> {
@@ -12,14 +12,15 @@ async fn main() -> Result<(), Box<dyn Error>> {
info!("Hello, world!");
info!("stuff: {:?} {:?} {:?} {:?} {:?}", System::name(), System::os_version(), System::long_os_version(), System::kernel_version(), System::cpu_arch());
info!("stuff: {:?} {:?} {:?} {}", System::distribution_id(), OS, ARCH, size_of::<*const i32>());
-
- let launcher = o3launcher::launcher::Launcher::new(PathBuf::from("./work").as_path(), true).await?;
- let profile = Profile {
- version_id: "1.21.4".into(),
- java_runtime: None,
- instance: "".into()
- };
- launcher.prepare_launch(&profile).await.map_err(|e| {
+
+ let settings = Settings::load("./work/ozone.json").await?;
+ settings.save().await?;
+
+ let launcher = Launcher::new("./work", true).await?;
+
+ let profile = settings.get_profile("default").unwrap();
+
+ launcher.prepare_launch(profile.get_version(), settings.get_instance_for(profile)).await.map_err(|e| {
error!("error launching: {e}");
e
})?;