diff --git a/CHANGELOG.md b/CHANGELOG.md index f0e2c2c90..110f8df84 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Change Log +## UNRELEASED - CLI + +- feat: Support `MODUS_HOME` environment variable [#639](https://github.com/hypermodeinc/modus/pull/639) + ## UNRELEASED - Runtime - fix: doc comments from object fields should be present in generated GraphQL schema [#630](https://github.com/hypermodeinc/modus/pull/630) diff --git a/cli/install.sh b/cli/install.sh index 88246487f..73674489a 100755 --- a/cli/install.sh +++ b/cli/install.sh @@ -12,7 +12,7 @@ # Config PACKAGE_ORG="@hypermode" PACKAGE_NAME="modus-cli" -INSTALL_DIR="${MODUS_CLI:-"$HOME/.modus/cli"}" +INSTALL_DIR="${MODUS_CLI:-"${MODUS_HOME:-"$HOME/.modus"}/cli"}" VERSION="latest" INSTALLER_VERSION="0.1.2" diff --git a/cli/src/custom/globals.ts b/cli/src/custom/globals.ts index 50aba6d08..85248877a 100644 --- a/cli/src/custom/globals.ts +++ b/cli/src/custom/globals.ts @@ -9,8 +9,9 @@ import path from "node:path"; import os from "node:os"; +import process from "node:process"; -export const ModusHomeDir = path.join(os.homedir(), ".modus"); +export const ModusHomeDir = process.env.MODUS_HOME || path.join(os.homedir(), ".modus"); export const MinNodeVersion = "22.0.0"; export const MinGoVersion = "1.23.0";