Skip to content

Commit ecfe769

Browse files
committed
Better check for production clerk
1 parent c10fbbc commit ecfe769

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

packages/cloud/src/Config.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
1-
export const getClerkBaseUrl = () => process.env.CLERK_BASE_URL || "https://clerk.roocode.com"
2-
export const getRooCodeApiUrl = () => process.env.ROO_CODE_API_URL || "https://app.roocode.com"
1+
// Production constants
2+
export const PRODUCTION_CLERK_BASE_URL = "https://clerk.roocode.com"
3+
export const PRODUCTION_ROO_CODE_API_URL = "https://app.roocode.com"
4+
5+
// Functions with environment variable fallbacks
6+
export const getClerkBaseUrl = () => process.env.CLERK_BASE_URL || PRODUCTION_CLERK_BASE_URL
7+
export const getRooCodeApiUrl = () => process.env.ROO_CODE_API_URL || PRODUCTION_ROO_CODE_API_URL

src/services/mdm/MdmService.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import * as os from "os"
44
import * as vscode from "vscode"
55
import { z } from "zod"
66

7-
import { CloudService } from "@roo-code/cloud"
7+
import { CloudService, getClerkBaseUrl, PRODUCTION_CLERK_BASE_URL } from "@roo-code/cloud"
88
import { Package } from "../../shared/package"
99

1010
// MDM Configuration Schema
@@ -145,7 +145,7 @@ export class MdmService {
145145
*/
146146
private getMdmConfigPath(): string {
147147
const platform = os.platform()
148-
const isProduction = process.env.NODE_ENV === "production"
148+
const isProduction = getClerkBaseUrl() === PRODUCTION_CLERK_BASE_URL
149149
const configFileName = isProduction ? "mdm.json" : "mdm.dev.json"
150150

151151
switch (platform) {

0 commit comments

Comments
 (0)