mirror of
https://github.com/elicpeter/nyx.git
synced 2026-06-15 20:05:13 +02:00
[pitboss/grind] deferred session-0003 (20260517T044708Z-e058)
This commit is contained in:
parent
6698eb96eb
commit
2544e5d9da
7 changed files with 257 additions and 10 deletions
|
|
@ -208,9 +208,12 @@ pub fn profile_path(name: &str) -> Option<PathBuf> {
|
|||
}
|
||||
let dir = profile_dir()?;
|
||||
let path = dir.join(format!("{key}.sb"));
|
||||
if !path.exists() {
|
||||
std::fs::write(&path, source).ok()?;
|
||||
}
|
||||
// Always overwrite on first miss in this process so an upgraded nyx
|
||||
// binary picks up new profile content even when a previous version
|
||||
// left a stale `.sb` file under `std::env::temp_dir()`. The in-process
|
||||
// `PROFILE_PATHS` cache then short-circuits subsequent lookups so the
|
||||
// write happens at most once per profile per process lifetime.
|
||||
std::fs::write(&path, source).ok()?;
|
||||
let mut cache = profile_paths().lock().ok()?;
|
||||
cache.insert(*key, path.clone());
|
||||
Some(path)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue