Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/services/mdm/MdmService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,22 +146,22 @@ export class MdmService {
private getMdmConfigPath(): string {
const platform = os.platform()
const isProduction = process.env.NODE_ENV === "production"
const configFileName = isProduction ? "mcp.json" : "mcp.dev.json"
const configFileName = isProduction ? "mdm.json" : "mdm.dev.json"

switch (platform) {
case "win32": {
// Windows: %ProgramData%\RooCode\mcp.json or mcp.dev.json
// Windows: %ProgramData%\RooCode\mdm.json or mcp.mdm.json
const programData = process.env.PROGRAMDATA || "C:\\ProgramData"
return path.join(programData, "RooCode", configFileName)
}

case "darwin":
// macOS: /Library/Application Support/RooCode/mcp.json or mcp.dev.json
// macOS: /Library/Application Support/RooCode/mdm.json or mdm.dev.json
return `/Library/Application Support/RooCode/${configFileName}`

case "linux":
default:
// Linux: /etc/roo-code/mcp.json or mcp.dev.json
// Linux: /etc/roo-code/mdm.json or mdm.dev.json
return `/etc/roo-code/${configFileName}`
}
}
Expand Down
14 changes: 7 additions & 7 deletions src/services/mdm/__tests__/MdmService.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ describe("MdmService", () => {

await MdmService.createInstance()

expect(mockFs.existsSync).toHaveBeenCalledWith(path.join("C:\\ProgramData", "RooCode", "mcp.json"))
expect(mockFs.existsSync).toHaveBeenCalledWith(path.join("C:\\ProgramData", "RooCode", "mdm.json"))
})

it("should use correct path for Windows in development", async () => {
Expand All @@ -160,7 +160,7 @@ describe("MdmService", () => {

await MdmService.createInstance()

expect(mockFs.existsSync).toHaveBeenCalledWith(path.join("C:\\ProgramData", "RooCode", "mcp.dev.json"))
expect(mockFs.existsSync).toHaveBeenCalledWith(path.join("C:\\ProgramData", "RooCode", "mdm.dev.json"))
})

it("should use correct path for macOS in production", async () => {
Expand All @@ -171,7 +171,7 @@ describe("MdmService", () => {

await MdmService.createInstance()

expect(mockFs.existsSync).toHaveBeenCalledWith("/Library/Application Support/RooCode/mcp.json")
expect(mockFs.existsSync).toHaveBeenCalledWith("/Library/Application Support/RooCode/mdm.json")
})

it("should use correct path for macOS in development", async () => {
Expand All @@ -182,7 +182,7 @@ describe("MdmService", () => {

await MdmService.createInstance()

expect(mockFs.existsSync).toHaveBeenCalledWith("/Library/Application Support/RooCode/mcp.dev.json")
expect(mockFs.existsSync).toHaveBeenCalledWith("/Library/Application Support/RooCode/mdm.dev.json")
})

it("should use correct path for Linux in production", async () => {
Expand All @@ -193,7 +193,7 @@ describe("MdmService", () => {

await MdmService.createInstance()

expect(mockFs.existsSync).toHaveBeenCalledWith("/etc/roo-code/mcp.json")
expect(mockFs.existsSync).toHaveBeenCalledWith("/etc/roo-code/mdm.json")
})

it("should use correct path for Linux in development", async () => {
Expand All @@ -204,7 +204,7 @@ describe("MdmService", () => {

await MdmService.createInstance()

expect(mockFs.existsSync).toHaveBeenCalledWith("/etc/roo-code/mcp.dev.json")
expect(mockFs.existsSync).toHaveBeenCalledWith("/etc/roo-code/mdm.dev.json")
})

it("should default to dev config when NODE_ENV is not set", async () => {
Expand All @@ -215,7 +215,7 @@ describe("MdmService", () => {

await MdmService.createInstance()

expect(mockFs.existsSync).toHaveBeenCalledWith("/Library/Application Support/RooCode/mcp.dev.json")
expect(mockFs.existsSync).toHaveBeenCalledWith("/Library/Application Support/RooCode/mdm.dev.json")
})
})

Expand Down