Remove Atomic sections from all hooks.
()
| 159 | |
| 160 | /// Remove Atomic sections from all hooks. |
| 161 | fn uninstall_hooks() -> CliResult<()> { |
| 162 | let hooks_dir = find_hooks_dir()?; |
| 163 | let mut removed = 0; |
| 164 | |
| 165 | for hook_name in HOOK_NAMES { |
| 166 | let hook_path = hooks_dir.join(hook_name); |
| 167 | if !hook_path.exists() { |
| 168 | continue; |
| 169 | } |
| 170 | match remove_atomic_section(&hook_path) { |
| 171 | Ok(true) => removed += 1, |
| 172 | Ok(false) => {} |
| 173 | Err(e) => { |
| 174 | print_warning(&format!("Failed to clean {}: {}", hook_name, e)); |
| 175 | } |
| 176 | } |
| 177 | } |
| 178 | |
| 179 | if removed > 0 { |
| 180 | print_info(&format!("Removed Atomic hooks from {} file(s).", removed)); |
| 181 | } else { |
| 182 | print_info("No Atomic hooks found."); |
| 183 | } |
| 184 | |
| 185 | Ok(()) |
| 186 | } |
| 187 | |
| 188 | /// Remove the atomic:git:begin..end section from a hook file. |
| 189 | /// Returns Ok(true) if something was removed. |
no test coverage detected