| 673 | } |
| 674 | |
| 675 | int cbm_remove_skills(const char *skills_dir, bool dry_run) { |
| 676 | if (!skills_dir) { |
| 677 | return 0; |
| 678 | } |
| 679 | int count = 0; |
| 680 | |
| 681 | for (int i = 0; i < CBM_SKILL_COUNT; i++) { |
| 682 | char skill_path[CLI_BUF_1K]; |
| 683 | snprintf(skill_path, sizeof(skill_path), "%s/%s", skills_dir, skills[i].name); |
| 684 | struct stat st; |
| 685 | if (stat(skill_path, &st) != 0) { |
| 686 | continue; |
| 687 | } |
| 688 | |
| 689 | if (dry_run) { |
| 690 | count++; |
| 691 | continue; |
| 692 | } |
| 693 | |
| 694 | if (rmdir_recursive(skill_path) == 0) { |
| 695 | count++; |
| 696 | } |
| 697 | } |
| 698 | return count; |
| 699 | } |
| 700 | |
| 701 | bool cbm_remove_old_monolithic_skill(const char *skills_dir, bool dry_run) { |
| 702 | if (!skills_dir) { |
no test coverage detected