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.
This commit is contained in:
wangjichao 2026-04-09 10:07:28 +08:00
parent d9ba9aa998
commit 79ec9f6052

View file

@ -212,7 +212,7 @@ export const addToGitignore = async (repoPath: string): Promise<void> => {
* 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');
};
/**