Skip to content

Commit 4997701

Browse files
committed
Enhance export method in ContextProxy to filter out project custom modes, ensuring only global settings are included in the export.
1 parent c5f48a8 commit 4997701

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/core/config/ContextProxy.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,10 @@ export class ContextProxy {
229229
public async export(): Promise<GlobalSettings | undefined> {
230230
try {
231231
const globalSettings = globalSettingsExportSchema.parse(this.getValues())
232+
233+
// Exports should only contain global settings, so this skips project custom modes (those exist in the .roomode folder)
234+
globalSettings.customModes = globalSettings.customModes?.filter((mode) => mode.source === "global")
235+
232236
return Object.fromEntries(Object.entries(globalSettings).filter(([_, value]) => value !== undefined))
233237
} catch (error) {
234238
if (error instanceof ZodError) {

0 commit comments

Comments
 (0)