paths: flat state layout when DAMOCLES_WORKSPACE is set
This commit is contained in:
parent
2987508afe
commit
2526dc688c
1 changed files with 9 additions and 1 deletions
|
|
@ -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 {
|
pub fn state_dir() -> PathBuf {
|
||||||
|
if std::env::var("DAMOCLES_WORKSPACE").is_ok() {
|
||||||
|
workspace_dir()
|
||||||
|
} else {
|
||||||
workspace_dir().join("state")
|
workspace_dir().join("state")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn identity_dir() -> PathBuf {
|
pub fn identity_dir() -> PathBuf {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue