polish repl (#17)

* add less daunting panic message on release builds
This commit is contained in:
Chance 2024-12-21 14:35:55 -05:00 committed by BitSyndicate
parent 0e255ea359
commit f286a2b624
Signed by: bitsyndicate
GPG key ID: 443E4198D6BBA6DE
17 changed files with 405 additions and 106 deletions

View file

@ -1,18 +1,33 @@
use core::{repl::{handler::COMMAND_MANAGER, input::handle_repl, setup}, splash};
#![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;
#[tokio::main]
async fn main() -> anyhow::Result<()> {
setup();
splash::print_splash();
COMMAND_MANAGER.read().execute("help", None)?;
let t = tokio::spawn(handle_repl());
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()?;
t.await??;
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(())