zenyx-engine/engine/src/main.rs
Cazdotsys c57e5c2d49 polish repl (#17)
* add less daunting panic message on release builds
2025-04-19 21:01:37 +02:00

34 lines
738 B
Rust

#![feature(panic_payload_as_str)]
use core::{
panic::set_panic_hook,
repl::{handler::COMMAND_MANAGER, setup},
splash, workspace,
};
use anyhow::Ok;
use colored::Colorize;
use tokio::runtime;
pub mod core;
fn main() -> anyhow::Result<()> {
if !cfg!(debug_assertions) {
println!("{}", "Debug mode disabled".bright_blue());
set_panic_hook();
}
let runtime = runtime::Builder::new_current_thread()
.enable_all()
.build()?;
runtime.block_on(async {
setup();
splash::print_splash();
COMMAND_MANAGER.read().execute("help", None)?;
let t = tokio::spawn(core::repl::input::handle_repl());
t.await??;
Ok(())
})?;
Ok(())
}