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

Function uninstall_hooks

atomic-cli/src/commands/git/hooks.rs:182–207  ·  view source on GitHub ↗

Remove Atomic sections from all hooks.

()

Source from the content-addressed store, hash-verified

180
181/// Remove Atomic sections from all hooks.
182fn uninstall_hooks() -> CliResult<()> {
183 let hooks_dir = find_hooks_dir()?;
184 let mut removed = 0;
185
186 for hook_name in HOOK_NAMES {
187 let hook_path = hooks_dir.join(hook_name);
188 if !hook_path.exists() {
189 continue;
190 }
191 match remove_atomic_section(&hook_path) {
192 Ok(true) => removed += 1,
193 Ok(false) => {}
194 Err(e) => {
195 print_warning(&format!("Failed to clean {}: {}", hook_name, e));
196 }
197 }
198 }
199
200 if removed > 0 {
201 print_info(&format!("Removed Atomic hooks from {} file(s).", removed));
202 } else {
203 print_info("No Atomic hooks found.");
204 }
205
206 Ok(())
207}
208
209/// Remove the atomic:git:begin..end section from a hook file.
210/// Returns Ok(true) if something was removed.

Callers 1

runMethod · 0.85

Calls 5

find_hooks_dirFunction · 0.85
remove_atomic_sectionFunction · 0.85
print_warningFunction · 0.85
print_infoFunction · 0.85
existsMethod · 0.45

Tested by

no test coverage detected