Skip to content

Commit 2da5c5c

Browse files
committed
Fix CustomModesManager issues: replace entry.parentPath with path.join and improve type safety
1 parent 9fffe16 commit 2da5c5c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/core/config/CustomModesManager.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,8 @@ export class CustomModesManager {
592592

593593
for (const entry of entries) {
594594
if (entry.isFile()) {
595-
const filePath = path.join(entry.parentPath || modeRulesDir, entry.name)
595+
// Use path.join with modeRulesDir and entry.name for compatibility
596+
const filePath = path.join(modeRulesDir, entry.name)
596597
const content = await fs.readFile(filePath, "utf-8")
597598
if (content.trim()) {
598599
return true // Found at least one file with content
@@ -679,7 +680,8 @@ export class CustomModesManager {
679680

680681
for (const entry of entries) {
681682
if (entry.isFile()) {
682-
const filePath = path.join(entry.parentPath || modeRulesDir, entry.name)
683+
// Use path.join with modeRulesDir and entry.name for compatibility
684+
const filePath = path.join(modeRulesDir, entry.name)
683685
const content = await fs.readFile(filePath, "utf-8")
684686
if (content.trim()) {
685687
// Calculate relative path from .roo directory
@@ -697,7 +699,7 @@ export class CustomModesManager {
697699
const exportMode: ExportedModeConfig = {
698700
...mode,
699701
// Remove source property for export
700-
source: undefined as any,
702+
source: "project" as const,
701703
}
702704

703705
// Add rules files if any exist

0 commit comments

Comments
 (0)