Skip to main content

write_project_pin

Function write_project_pin 

Source
pub fn write_project_pin(root: &Path, pin: &ProjectPin) -> Result<PathBuf>
Expand description

Write a palace pin to .trusty-tools/trusty-memory.yaml at root.

Why: the lazy-write path in project_slug_at and the explicit trusty-memory link backfill command both need to emit the same YAML schema. A single writer keeps the format consistent and avoids duplicated YAML-construction logic. What: creates .trusty-tools/ if missing, serialises pin with serde_yaml, and writes it atomically (write to <file>.tmp, then rename). Returns the path that was written. Test: write_project_pin_creates_expected_yaml, write_project_pin_round_trips_through_read.