paths: flat state layout when DAMOCLES_WORKSPACE is set

This commit is contained in:
damocles 2026-05-16 04:35:19 +02:00
parent 2987508afe
commit 2526dc688c

View file

@ -15,8 +15,16 @@ pub fn workspace_dir() -> PathBuf {
}
}
/// Runtime state dir. When `DAMOCLES_WORKSPACE` is set (hyperhive flat
/// layout) the state files live directly in the workspace — no `state/`
/// subdirectory. In the legacy `/workspace` layout they live in
/// `<workspace>/state/`.
pub fn state_dir() -> PathBuf {
workspace_dir().join("state")
if std::env::var("DAMOCLES_WORKSPACE").is_ok() {
workspace_dir()
} else {
workspace_dir().join("state")
}
}
pub fn identity_dir() -> PathBuf {