Skip to content

Commit cf4193c

Browse files
committed
chore: Add cleanup for existing Merico workflow directory
- Add safety check to remove existing workflow directory if present - Ensure clean installation by removing old files before copying - Prevent potential conflicts during version updates
1 parent 6ac60e7 commit cf4193c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/contributes/commands.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,9 @@ export function registerInstallCommandsCommand(
219219
let copiedDirectory = false;
220220
if (!fs.existsSync(sysMericoDirPath) || (updatePublicWorkflow === false && currentVersion !== previousVersion)) {
221221
logger.channel()?.debug("Creating directory: " + sysMericoDirPath);
222+
if (fs.existsSync(sysMericoDirPath)) {
223+
fs.rmSync(sysMericoDirPath, { recursive: true, force: true });
224+
}
222225
await copyDirectory(pluginDirPath, sysDirPath);
223226
copiedDirectory = true;
224227
}

0 commit comments

Comments
 (0)