Skip to main content

write_file

Function write_file 

Source
pub fn write_file(
    path: &Path,
    content: &str,
    policy: WritePolicy,
) -> Result<bool>
Expand description

Write content to path according to policy, creating parent directories as needed.

Returns Ok(true) when the file was created or modified, Ok(false) when it was left untouched (i.e. SkipExisting and the file already exists).

WritePolicy::Append is only meaningful for instruction files (handled via [append_instruction]); here it behaves like Force so non-instruction files (skills/agents) are refreshed.