MCPcopy
hub / github.com/EveryInc/compound-engineering-plugin / moveLegacyArtifactToBackup

Function moveLegacyArtifactToBackup

src/targets/pi.ts:486–498  ·  view source on GitHub ↗
(
  managedDir: string,
  kind: LegacyArtifactKind,
  artifactPath: string,
)

Source from the content-addressed store, hash-verified

484}
485
486async 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
500export {
501 cleanupRemovedSkills as cleanupRemovedPiSkills,

Callers 1

Calls 2

pathExistsFunction · 0.90
ensureDirFunction · 0.90

Tested by

no test coverage detected