Remove Atomic sections from all hooks.
()
| 180 | |
| 181 | /// Remove Atomic sections from all hooks. |
| 182 | fn 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. |
no test coverage detected