Merge pull request #600 from devchat-ai/chore/cleanup-merico-workflow-dir

chore: Add cleanup for existing Merico workflow directory
This commit is contained in:
boob.yang 2024-12-18 10:43:47 +08:00 committed by GitHub
commit 53d764c184
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -219,6 +219,9 @@ export function registerInstallCommandsCommand(
let copiedDirectory = false;
if (!fs.existsSync(sysMericoDirPath) || (updatePublicWorkflow === false && currentVersion !== previousVersion)) {
logger.channel()?.debug("Creating directory: " + sysMericoDirPath);
if (fs.existsSync(sysMericoDirPath)) {
fs.rmSync(sysMericoDirPath, { recursive: true, force: true });
}
await copyDirectory(pluginDirPath, sysDirPath);
copiedDirectory = true;
}