improve error handling and add metadata

This commit is contained in:
Chance 2025-04-03 01:00:24 -04:00 committed by BitSyndicate
parent 10932a1a97
commit 710c8e52bd
Signed by untrusted user: bitsyndicate
GPG key ID: 443E4198D6BBA6DE
17 changed files with 1162 additions and 787 deletions

View file

@ -1,4 +1,5 @@
use std::error::Error;
use std::str::FromStr;
use std::{error::Error, path::PathBuf};
use std::fmt::Write as FmtWrite;
use std::mem;
@ -24,11 +25,11 @@ pub fn set_panic_hook() {
}
fn process_panic(info: &std::panic::PanicHookInfo<'_>) -> Result<(), Box<dyn Error>> {
use crate::workspace;
use colored::Colorize;
use std::io::Write;
let log_dir = workspace::get_working_dir()?;
let log_dir = PathBuf::from_str("./").expect("wtf, The current directory no longer exists?");
if !log_dir.exists() {
std::fs::create_dir_all(&log_dir)?;
}