MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / delete_file

Method delete_file

atomic-cli/src/commands/remove.rs:197–206  ·  view source on GitHub ↗

Delete a file from the filesystem.

(&self, repo_root: &std::path::Path, path: &str)

Source from the content-addressed store, hash-verified

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 {

Callers 1

runMethod · 0.45

Calls 2

is_dirMethod · 0.80
existsMethod · 0.45

Tested by

no test coverage detected