Skip to content

feat: support FORGE_FOLDER_PATH env var for base path#2724

Open
majiayu000 wants to merge 2 commits intoantinomyhq:mainfrom
majiayu000:feat/issue-2662-forge-folder-path-env
Open

feat: support FORGE_FOLDER_PATH env var for base path#2724
majiayu000 wants to merge 2 commits intoantinomyhq:mainfrom
majiayu000:feat/issue-2662-forge-folder-path-env

Conversation

@majiayu000
Copy link
Copy Markdown
Contributor

Fixes #2662

base_path was hardcoded to ~/forge in two places: ConfigReader::base_path() in forge_config and inline in to_environment() in forge_infra. This meant there was no way to change where Forge stores its data without modifying source.

Now ConfigReader::base_path() checks FORGE_FOLDER_PATH env var first and falls back to ~/forge if unset. The duplicated path logic in forge_infra/src/env.rs now calls ConfigReader::base_path() instead of computing it separately, so there's a single source of truth.

Two tests added: one confirming the env var override works, one confirming the default path is still ~/forge.

Check FORGE_FOLDER_PATH env var in ConfigReader::base_path() before
falling back to ~/forge. Deduplicate the base_path logic in env.rs
by reusing ConfigReader::base_path().

Closes antinomyhq#2662

Signed-off-by: majiayu000 <1835304752@qq.com>
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Mar 28, 2026

CLA assistant check
All committers have signed the CLA.

@majiayu000 majiayu000 marked this pull request as ready for review March 28, 2026 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Add forge folder path environment variable

2 participants