Skip to content

Commit 674145c

Browse files
a6b8claude
andcommitted
Fix localConfigPath scope in init #4
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent b16b7f3 commit 674145c

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/task/FlowMcpCli.mjs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,11 @@ class FlowMcpCli {
273273
}
274274
] )
275275

276-
const { data: currentLocalConfig } = await FlowMcpCli.#readJson( { filePath: localConfigPath } )
276+
const localGroupDir = join( cwd, appConfig[ 'localConfigDirName' ] )
277+
await mkdir( localGroupDir, { recursive: true } )
278+
const localGroupConfigPath = join( localGroupDir, 'config.json' )
279+
280+
const { data: currentLocalConfig } = await FlowMcpCli.#readJson( { filePath: localGroupConfigPath } )
277281
const updatedLocalConfig = currentLocalConfig || { 'root': `~/${appConfig[ 'globalConfigDirName' ]}` }
278282

279283
if( !updatedLocalConfig[ 'groups' ] ) {
@@ -290,7 +294,7 @@ class FlowMcpCli {
290294
updatedLocalConfig[ 'defaultGroup' ] = trimmedGroupName
291295
}
292296

293-
await writeFile( localConfigPath, JSON.stringify( updatedLocalConfig, null, 4 ), 'utf-8' )
297+
await writeFile( localGroupConfigPath, JSON.stringify( updatedLocalConfig, null, 4 ), 'utf-8' )
294298

295299
console.log( ` ${chalk.green( '\u2713' )} Group "${trimmedGroupName}" created with ${selectedTools.length} tool(s)` )
296300
if( updatedLocalConfig[ 'defaultGroup' ] === trimmedGroupName ) {

0 commit comments

Comments
 (0)