Skip to content

feat: support DOTM_DIR env var for dotfiles directory - #20

Merged
cebarks merged 1 commit into
mainfrom
feat/dotm-dir-env-var
Aug 13, 2026
Merged

feat: support DOTM_DIR env var for dotfiles directory#20
cebarks merged 1 commit into
mainfrom
feat/dotm-dir-env-var

Conversation

@cebarks

@cebarks cebarks commented Aug 13, 2026

Copy link
Copy Markdown
Owner

Allow setting the dotfiles directory via the DOTM_DIR environment variable as a fallback when --dir/-d is not passed on the CLI.

Precedence: --dir flag > DOTM_DIR env var > . (cwd)

Changes

  • Enable clap env feature in Cargo.toml
  • Add env = "DOTM_DIR" to the --dir arg in main.rs
  • Add CLI tests for env var fallback and flag-overrides-env precedence
  • Update README CLI reference

Usage

# Set once in your shell rc
export DOTM_DIR=~/dotfiles

# Now works from anywhere
dotm status
dotm deploy

Allow setting the dotfiles directory via the DOTM_DIR environment
variable as a fallback when --dir/-d is not passed on the CLI.

Precedence: --dir flag > DOTM_DIR env var > . (cwd)

- Enable clap 'env' feature in Cargo.toml
- Add env = "DOTM_DIR" to the --dir arg in main.rs
- Add CLI tests for env var fallback and flag override
- Update README CLI reference
@cebarks
cebarks force-pushed the feat/dotm-dir-env-var branch from 93151a3 to bdbafcc Compare August 13, 2026 17:54
@cebarks
cebarks merged commit 8c14a06 into main Aug 13, 2026
2 checks passed
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.

1 participant