Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
6 changes: 3 additions & 3 deletions src/constants/paths.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { join } from "path";

/**
* Get the root directory for all cmux configuration and data.
* Can be overridden with CMUX_TEST_ROOT environment variable.
* Can be overridden with CMUX_ROOT environment variable.
* Appends '-dev' suffix when NODE_ENV=development (explicit dev mode).
*
* This is a getter function to support test mocking of os.homedir().
Expand All @@ -13,9 +13,9 @@ import { join } from "path";
*/
export function getCmuxHome(): string {
// eslint-disable-next-line no-restricted-syntax, no-restricted-globals
if (process.env.CMUX_TEST_ROOT) {
if (process.env.CMUX_ROOT) {
// eslint-disable-next-line no-restricted-syntax, no-restricted-globals
return process.env.CMUX_TEST_ROOT;
return process.env.CMUX_ROOT;
}

const baseName = ".cmux";

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Removing -dev suffix is incomplete

The change description says make start should now use ~/.cmux by default, but getCmuxHome() still appends a "-dev" suffix whenever NODE_ENV === "development". The start make target continues to set NODE_ENV=development, so after this commit the default runtime path is still ~/.cmux-dev unless callers manually set CMUX_ROOT. This keeps the old behavior and defeats the goal of switching to the production data directory by default. To actually restore ~/.cmux, either remove the suffix logic here or stop forcing NODE_ENV=development when starting the app.

Useful? React with 👍 / 👎.

Expand Down
2 changes: 1 addition & 1 deletion src/main-desktop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const forceDistLoad = process.env.CMUX_E2E_LOAD_DIST === "1";

if (isE2ETest) {
// For e2e tests, use a test-specific userData directory
// Note: getCmuxHome() already respects CMUX_TEST_ROOT for test isolation
// Note: getCmuxHome() already respects CMUX_ROOT for test isolation
const e2eUserData = path.join(getCmuxHome(), "user-data");
try {
fs.mkdirSync(e2eUserData, { recursive: true });
Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/electronTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ function buildTarget(target: string): void {

export const electronTest = base.extend<ElectronFixtures>({
workspace: async ({}, use, testInfo) => {
const envRoot = process.env.CMUX_TEST_ROOT ?? "";
const envRoot = process.env.CMUX_ROOT ?? "";
const baseRoot = envRoot || defaultTestRoot;
const uniqueTestId = testInfo.testId || testInfo.title || `test-${Date.now()}`;
const testRoot = envRoot ? baseRoot : path.join(baseRoot, sanitizeForPath(uniqueTestId));
Expand Down Expand Up @@ -195,7 +195,7 @@ export const electronTest = base.extend<ElectronFixtures>({
}
electronEnv.ELECTRON_DISABLE_SECURITY_WARNINGS = "true";
electronEnv.CMUX_MOCK_AI = electronEnv.CMUX_MOCK_AI ?? "1";
electronEnv.CMUX_TEST_ROOT = configRoot;
electronEnv.CMUX_ROOT = configRoot;
electronEnv.CMUX_E2E = "1";
electronEnv.CMUX_E2E_LOAD_DIST = shouldLoadDist ? "1" : "0";
electronEnv.VITE_DISABLE_MERMAID = "1";
Expand Down