From 79ec9f605298b658f5edc68efbfdbe3b222052a7 Mon Sep 17 00:00:00 2001 From: wangjichao Date: Thu, 9 Apr 2026 10:07:28 +0800 Subject: [PATCH] feat: support GITNEXUS_HOME env var to customize global directory Allow users to override the default ~/.gitnexus directory by setting the GITNEXUS_HOME environment variable. --- gitnexus/src/storage/repo-manager.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gitnexus/src/storage/repo-manager.ts b/gitnexus/src/storage/repo-manager.ts index cc447aa4c..b233d44fb 100644 --- a/gitnexus/src/storage/repo-manager.ts +++ b/gitnexus/src/storage/repo-manager.ts @@ -212,7 +212,7 @@ export const addToGitignore = async (repoPath: string): Promise => { * Get the path to the global GitNexus directory */ export const getGlobalDir = (): string => { - return path.join(os.homedir(), '.gitnexus'); + return process.env.GITNEXUS_HOME || path.join(os.homedir(), '.gitnexus'); }; /**