Skip to content

Commit bee9868

Browse files
committed
feat: print info about overwritten entries
1 parent cd84f05 commit bee9868

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

libs/roo-rocket/src/cli-entry.ts

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,12 @@ rooRocketUnpackHookable.hook('onFileOutputJsonMerge', async (state) => {
3333
const newData = JSON.parse(state.data)
3434
const mergedData = defu(newData, oldData)
3535
const dedupedModes = mergedData.customModes.filter((mode: any) => {
36-
if (!existingModeSlugs.has(mode.slug))
37-
return existingModeSlugs.add(mode.slug)
38-
return false
36+
if (existingModeSlugs.has(mode.slug)) {
37+
logger.info(`Present roomode entry overwritten: ${mode.slug}`)
38+
return false
39+
}
40+
41+
return existingModeSlugs.add(mode.slug) && true
3942
})
4043

4144
const result = { ...mergedData, customModes: dedupedModes }
@@ -50,8 +53,12 @@ rooRocketUnpackHookable.hook('onFileOutputJsonMerge', async (state) => {
5053
const newData = JSON.parse(state.data)
5154
const mergedData = structuredClone(newData)
5255
for (const [key, value] of Object.entries(oldData.mcpServers)) {
53-
if (!(key in mergedData.mcpServers))
54-
mergedData.mcpServers[key] = value
56+
if (key in mergedData.mcpServers) {
57+
logger.info(`Present mcp server entry overwritten: ${key}`)
58+
continue
59+
}
60+
61+
mergedData.mcpServers[key] = value
5562
}
5663

5764
state.mergeResult = JSON.stringify(mergedData, null, 2)

0 commit comments

Comments
 (0)