summaryrefslogtreecommitdiffstats
path: root/ozone-cli/src/main.rs
blob: a17979efa41838ba36078dc3e9efd13a2f0bfafb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
use std::error::Error;
use log::{error, info};
use ozone::launcher::{Launcher, Settings};

#[tokio::main]
async fn main() -> Result<(), Box<dyn Error>> {
    simple_logger::SimpleLogger::new().env().init().unwrap();

    info!("Sensible home could be {:?}", Launcher::sensible_home());
    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();

    let launch = launcher.prepare_launch(profile, settings.get_instance_for(profile)).await.map_err(|e| {
        error!("error launching: {e}");
        e
    })?;
    
    dbg!(&launch);
    info!("ok");

    ozone::launcher::run_the_game(&launch)?;
    
    Ok(())
}