Delete a file from the filesystem.
(&self, repo_root: &std::path::Path, path: &str)
| 195 | |
| 196 | /// Delete a file from the filesystem. |
| 197 | fn delete_file(&self, repo_root: &std::path::Path, path: &str) -> std::io::Result<()> { |
| 198 | let full_path = repo_root.join(path); |
| 199 | if full_path.is_dir() { |
| 200 | std::fs::remove_dir_all(&full_path) |
| 201 | } else if full_path.exists() { |
| 202 | std::fs::remove_file(&full_path) |
| 203 | } else { |
| 204 | Ok(()) // Already doesn't exist |
| 205 | } |
| 206 | } |
| 207 | |
| 208 | /// Format the output message based on mode. |
| 209 | fn format_action(&self) -> &'static str { |