@@ -191,6 +191,7 @@ export function registerInstallCommandsCommand(
191191 let disposable = vscode . commands . registerCommand (
192192 "DevChat.InstallCommands" ,
193193 async ( ) => {
194+ logger . channel ( ) ?. debug ( "InstallCommands command triggered." ) ;
194195 const homePath = process . env . HOME || process . env . USERPROFILE || "" ;
195196 const sysDirPath = path . join ( homePath , ".chat" , "scripts" ) ;
196197 const sysMericoDirPath = path . join ( homePath , ".chat" , "scripts" , "merico" ) ;
@@ -202,17 +203,20 @@ export function registerInstallCommandsCommand(
202203 const dcClient = new DevChatClient ( ) ;
203204
204205 if ( ! fs . existsSync ( sysMericoDirPath ) ) {
206+ logger . channel ( ) ?. debug ( "Creating directory: " + sysMericoDirPath ) ;
205207 await copyDirectory ( pluginDirPath , sysDirPath ) ;
206208 }
207209
208210 // Check if ~/.chat/scripts directory exists
209- if ( ! fs . existsSync ( sysDirPath ) ) {
211+ if ( ! fs . existsSync ( sysMericoDirPath ) ) {
210212 // Directory does not exist, wait for updateWorkflows to finish
213+ logger . channel ( ) ?. debug ( "Update workflows..." ) ;
211214 await dcClient . updateWorkflows ( ) ;
212215 await dcClient . updateCustomWorkflows ( ) ;
213216 sendCommandListByDevChatRun ( ) ;
214217 } else {
215218 // Directory exists, execute sendCommandListByDevChatRun immediately
219+ logger . channel ( ) ?. debug ( "Sending and updating workflows..." ) ;
216220 await sendCommandListByDevChatRun ( ) ;
217221
218222 // Then asynchronously execute updateWorkflows
0 commit comments