From dab5b2a5307efb7f690f434ff1e60e8a44ddad38 Mon Sep 17 00:00:00 2001 From: "bobo.yang" Date: Tue, 5 Nov 2024 11:28:51 +0800 Subject: [PATCH] update install commands logs --- src/contributes/commands.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/contributes/commands.ts b/src/contributes/commands.ts index 8eda1db..d0559fe 100644 --- a/src/contributes/commands.ts +++ b/src/contributes/commands.ts @@ -191,6 +191,7 @@ export function registerInstallCommandsCommand( let disposable = vscode.commands.registerCommand( "DevChat.InstallCommands", async () => { + logger.channel()?.debug("InstallCommands command triggered."); const homePath = process.env.HOME || process.env.USERPROFILE || ""; const sysDirPath = path.join(homePath, ".chat", "scripts"); const sysMericoDirPath = path.join(homePath, ".chat", "scripts", "merico"); @@ -202,17 +203,20 @@ export function registerInstallCommandsCommand( const dcClient = new DevChatClient(); if (!fs.existsSync(sysMericoDirPath)) { + logger.channel()?.debug("Creating directory: " + sysMericoDirPath); await copyDirectory(pluginDirPath, sysDirPath); } // Check if ~/.chat/scripts directory exists - if (!fs.existsSync(sysDirPath)) { + if (!fs.existsSync(sysMericoDirPath)) { // Directory does not exist, wait for updateWorkflows to finish + logger.channel()?.debug("Update workflows..."); await dcClient.updateWorkflows(); await dcClient.updateCustomWorkflows(); sendCommandListByDevChatRun(); } else { // Directory exists, execute sendCommandListByDevChatRun immediately + logger.channel()?.debug("Sending and updating workflows..."); await sendCommandListByDevChatRun(); // Then asynchronously execute updateWorkflows