( managedDir: string, kind: LegacyArtifactKind, artifactPath: string, )
| 484 | } |
| 485 | |
| 486 | async function moveLegacyArtifactToBackup( |
| 487 | managedDir: string, |
| 488 | kind: LegacyArtifactKind, |
| 489 | artifactPath: string, |
| 490 | ): Promise<void> { |
| 491 | if (!(await pathExists(artifactPath))) return |
| 492 | const timestamp = new Date().toISOString().replace(/[:.]/g, "-") |
| 493 | const backupDir = path.join(managedDir, "legacy-backup", timestamp, kind) |
| 494 | const backupPath = path.join(backupDir, path.basename(artifactPath)) |
| 495 | await ensureDir(backupDir) |
| 496 | await fs.rename(artifactPath, backupPath) |
| 497 | console.warn(`Moved legacy Pi ${LEGACY_ARTIFACT_LABELS[kind]} artifact to ${backupPath}`) |
| 498 | } |
| 499 | |
| 500 | export { |
| 501 | cleanupRemovedSkills as cleanupRemovedPiSkills, |
no test coverage detected