UI-Loading Messages with more (Optional) Data

This commit is contained in:
Alex Emmet 2025-09-26 17:37:40 +02:00
commit a5ade7dd03
6 changed files with 114 additions and 38 deletions

View file

@ -91,6 +91,19 @@ pub fn save_file(path: &str, name: &str, value: &str) {
}
}
pub fn get_children(path: &str) -> Vec<String> {
let dir = Path::new(&get_directory()).join(path);
let mut children = Vec::new();
if let Ok(entries) = fs::read_dir(&dir) {
for entry in entries {
if let Ok(entry) = entry {
children.push(entry.file_name().to_string_lossy().to_string());
}
}
}
children
}
pub fn get_directory() -> String {
let exe = std::env::current_exe().unwrap_or_else(|_| PathBuf::from("."));
exe.parent()