diff --git a/src/commands/install.ts b/src/commands/install.ts index b4c015e..d65f159 100644 --- a/src/commands/install.ts +++ b/src/commands/install.ts @@ -259,6 +259,7 @@ async function installSingleLocalSkill( process.exit(1); } + rmSync(targetPath, { recursive: true, force: true }); cpSync(skillDir, targetPath, { recursive: true, dereference: true }); writeSkillMetadata(targetPath, buildLocalMetadata(sourceInfo, skillDir)); @@ -308,6 +309,7 @@ async function installSpecificSkill( console.error(chalk.red(`Security error: Installation path outside target directory`)); process.exit(1); } + rmSync(targetPath, { recursive: true, force: true }); cpSync(skillDir, targetPath, { recursive: true, dereference: true }); writeSkillMetadata(targetPath, buildGitMetadata(sourceInfo, skillSubpath)); @@ -472,6 +474,7 @@ async function installFromRepo( console.error(chalk.red(`Security error: Installation path outside target directory`)); continue; } + rmSync(info.targetPath, { recursive: true, force: true }); cpSync(info.skillDir, info.targetPath, { recursive: true, dereference: true }); writeSkillMetadata(info.targetPath, buildMetadataFromSource(sourceInfo, info.skillDir, repoDir));