Skip to content
Closed
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
4 changes: 2 additions & 2 deletions src/cli/lib/utils/globalConfig.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import chalk from "chalk";
import os from "os";
import path from "path";
import { rootDirectory } from "./utils.js";
import { Context } from "../../../bundler/context.js";
import { logError, logVerbose } from "../../../bundler/log.js";
import { z } from "zod";
import { CONVEX_CONFIG_PATH } from "./utils.js";

export function globalConfigPath(): string {
return path.join(rootDirectory(), "config.json");
return CONVEX_CONFIG_PATH;
}

// GlobalConfig is stored in a file that very old versions of Convex also need to access.
Expand Down
9 changes: 5 additions & 4 deletions src/cli/lib/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ import {

const retryingFetch = fetchRetryFactory(fetch);

export function rootDirectory(): string {
return path.join(os.homedir(), `.${convexName()}`);
}

export const productionProvisionHost = "https://api.convex.dev";
export const provisionHost =
process.env.CONVEX_PROVISION_HOST || productionProvisionHost;
Expand All @@ -34,6 +38,7 @@ export const CONVEX_DEPLOYMENT_ENV_VAR_NAME = "CONVEX_DEPLOYMENT";
export const CONVEX_SELF_HOSTED_URL_VAR_NAME = "CONVEX_SELF_HOSTED_URL";
export const CONVEX_SELF_HOSTED_ADMIN_KEY_VAR_NAME =
"CONVEX_SELF_HOSTED_ADMIN_KEY";
export const CONVEX_CONFIG_PATH = path.join(rootDirectory(), "config.json");
const MAX_RETRIES = 6;
// After 3 retries, log a progress message that we're retrying the request
const RETRY_LOG_THRESHOLD = 3;
Expand Down Expand Up @@ -552,10 +557,6 @@ function convexName() {
return "convex";
}

export function rootDirectory(): string {
return path.join(os.homedir(), `.${convexName()}`);
}

export function cacheDir() {
const name = convexName();
const platform = process.platform;
Expand Down