restoreBackup undoes a partial swap by removing any freshly installed entries and moving the original entries back from backup into dest.
(dest, backup string, movedOut, movedIn []string)
| 510 | // restoreBackup undoes a partial swap by removing any freshly installed |
| 511 | // entries and moving the original entries back from backup into dest. |
| 512 | func restoreBackup(dest, backup string, movedOut, movedIn []string) { |
| 513 | for _, name := range movedIn { |
| 514 | _ = os.RemoveAll(filepath.Join(dest, name)) |
| 515 | } |
| 516 | for _, name := range movedOut { |
| 517 | _ = os.Rename(filepath.Join(backup, name), filepath.Join(dest, name)) |
| 518 | } |
| 519 | _ = os.RemoveAll(backup) |
| 520 | } |
| 521 | |
| 522 | // scanAllAgents walks every registered agent's skill directory (project + user scope) and |
| 523 | // collects installed skills. Shared install roots are scanned only once. |
no test coverage detected