From 6d0e4b431633f0dd35624a3e1ed2d4b302ba38f3 Mon Sep 17 00:00:00 2001 From: Matt Johnson-Pint Date: Mon, 9 Dec 2024 11:09:26 -0800 Subject: [PATCH 1/2] Support MODUS_HOME --- cli/install.sh | 2 +- cli/src/custom/globals.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) 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"; From d141f2de7752525aa42aa940a606388aefd7a2fc Mon Sep 17 00:00:00 2001 From: Matt Johnson-Pint Date: Mon, 9 Dec 2024 11:11:02 -0800 Subject: [PATCH 2/2] Update CHANGELOG.md --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) 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)