zenyx-engine/engine/src/core/workspace/mod.rs
Cazdotsys d9cd447ecb
polish repl (#17)
* add less daunting panic message on release builds
2025-04-22 20:54:14 +02:00

17 lines
463 B
Rust

use std::path::PathBuf;
use anyhow::{Context, Result, anyhow};
pub fn get_working_dir() -> Result<PathBuf> {
let mut dir = dirs_next::data_dir()
.ok_or(anyhow!("Expected working directory, found: None"))
.context("Could not fetch working dir")?;
dir.push("Zenyx");
Ok(dir)
}
pub fn get_data_dir() -> Result<PathBuf> {
let mut dir = get_working_dir().context("Failed to obtain working dir")?;
dir.push("data");
Ok(dir)
}