Skip to content

fix(path): respect XDG_DATA_HOME on macOS and Windows#222

Merged
CalvinAllen merged 1 commit intomainfrom
fix/path/xdg-data-home-on-macos-windows
Feb 9, 2026
Merged

fix(path): respect XDG_DATA_HOME on macOS and Windows#222
CalvinAllen merged 1 commit intomainfrom
fix/path/xdg-data-home-on-macos-windows

Conversation

@CalvinAllen
Copy link
Contributor

Summary

  • ShimsDir() in path/path.go, get_dtvem_root() in install.sh, and Get-DtvemRoot in install.ps1 were not checking XDG_DATA_HOME on macOS/Windows, causing dtvem init to add wrong paths (~/.dtvem/bin and ~/.dtvem/shims) to PATH when XDG_DATA_HOME was set
  • Added XDG_DATA_HOME opt-in checks to all three locations, bringing them in sync with the canonical getRootDir() logic in config/paths.go
  • Added 4 new tests for ShimsDir() covering DTVEM_ROOT override, XDG on non-Linux, no-XDG fallback, and DTVEM_ROOT-over-XDG precedence

Closes #202

Test plan

  • Verify go vet ./... passes
  • Verify go test ./... passes (including new ShimsDir XDG tests)
  • Verify golangci-lint run ./... reports 0 issues
  • CI build passes on all platforms (Windows, macOS, Linux)

ShimsDir(), install.sh, and install.ps1 were not checking
XDG_DATA_HOME on macOS/Windows, causing dtvem init to add
wrong paths to PATH when XDG_DATA_HOME was set. This brings
all three locations in sync with the canonical getRootDir()
logic in config/paths.go.

Closes #202
@CalvinAllen CalvinAllen merged commit 7adf0e8 into main Feb 9, 2026
17 checks passed
@CalvinAllen CalvinAllen deleted the fix/path/xdg-data-home-on-macos-windows branch February 9, 2026 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Support XDG Base Directory Specification on Windows

1 participant