Delete the receipt file. Returns `true` if one existed.
(agent: &str)
| 145 | |
| 146 | /// Delete the receipt file. Returns `true` if one existed. |
| 147 | pub fn remove(agent: &str) -> AgentResult<bool> { |
| 148 | let path = receipt_path(agent)?; |
| 149 | if path.exists() { |
| 150 | std::fs::remove_file(&path)?; |
| 151 | // Best-effort cleanup of the per-agent dir if now empty. |
| 152 | if let Ok(dir) = agent_dir(agent) { |
| 153 | let _ = std::fs::remove_dir(&dir); |
| 154 | } |
| 155 | Ok(true) |
| 156 | } else { |
| 157 | Ok(false) |
| 158 | } |
| 159 | } |
| 160 | |
| 161 | /// Look up the hash we recorded for a destination, if we installed it. |
| 162 | pub fn recorded_hash(&self, dst: &Path) -> Option<&str> { |
nothing calls this directly
no test coverage detected