use anyhow::Result;
use std::process::Command;
use crate::config::load_config;
pub fn run() -> Result<()> {
let config = load_config()?;
info!("Starting {} ...", config.paths.main_class);
let status = match Command::new("java")
.arg("-cp")
.arg(config.paths.class_dir)
.arg(&config.paths.main_class)
.status()
{
Ok(status) => status,
Err(_) => {
error!("java could not be started")
}
};
if !status.success() {
error!("Execution failed");
}
Ok(())
}