Remove every tracedecay hook (command contains `"tracedecay"`) from the five events in `settings.json`, leaving non-tracedecay hooks intact.
(settings_path: &Path)
| 646 | /// Remove every tracedecay hook (command contains `"tracedecay"`) from the |
| 647 | /// five events in `settings.json`, leaving non-tracedecay hooks intact. |
| 648 | fn migrate_remove_hooks(settings_path: &Path) { |
| 649 | if !settings_path.exists() { |
| 650 | return; |
| 651 | } |
| 652 | let Ok(mut settings) = load_json_file_strict(settings_path) else { |
| 653 | return; |
| 654 | }; |
| 655 | if remove_tracedecay_hooks(&mut settings) && backup_and_write_json(settings_path, &settings) { |
| 656 | eprintln!( |
| 657 | "\x1b[32m✔\x1b[0m Migrated: removed config-managed hooks from {}", |
| 658 | settings_path.display() |
| 659 | ); |
| 660 | } |
| 661 | } |
| 662 | |
| 663 | /// Strip tracedecay hook entries from all managed events. Returns true if |
| 664 | /// anything was removed. Shared by migration and uninstall. |
no test coverage detected