Skip to content

feat(installer): add XDG Base Directory support on Linux#110

Merged
CalvinAllen merged 1 commit intomainfrom
feature/xdg-support
Dec 12, 2025
Merged

feat(installer): add XDG Base Directory support on Linux#110
CalvinAllen merged 1 commit intomainfrom
feature/xdg-support

Conversation

@CalvinAllen
Copy link
Contributor

Summary

  • Add XDG Base Directory Specification support on Linux
  • Use $XDG_DATA_HOME/dtvem if set, otherwise ~/.local/share/dtvem
  • Update install.sh to detect platform and use appropriate paths
  • Add comprehensive path selection rationale documentation in code
  • Add unit tests for XDG path selection logic

Path Selection

Platform Default Path Override
Linux $XDG_DATA_HOME/dtvem or ~/.local/share/dtvem DTVEM_ROOT
macOS ~/.dtvem DTVEM_ROOT
Windows %USERPROFILE%\.dtvem DTVEM_ROOT

Rationale

  • Linux: Follows XDG spec for proper integration with Linux desktop environments and backup tools
  • macOS: Uses dotfile convention familiar to Unix CLI tool users (like nvm, pyenv, rbenv)
  • Windows: Uses home directory for visibility and consistency with other platforms

Test plan

  • Unit tests for getXDGDataPath() function
  • Unit tests for XDG behavior on Linux (skipped on other platforms)
  • Unit tests verifying non-Linux platforms ignore XDG_DATA_HOME
  • Unit tests verifying DTVEM_ROOT overrides XDG on all platforms
  • All existing tests pass

Closes #91

Add support for XDG_DATA_HOME on Linux following the XDG Base Directory
Specification. This aligns dtvem with standard Linux conventions.

Changes:
- paths.go: Use $XDG_DATA_HOME/dtvem or ~/.local/share/dtvem on Linux
- install.sh: Detect platform and use XDG paths on Linux
- Add comprehensive documentation of path selection rationale
- Add unit tests for XDG path selection logic

Path Selection Summary:
- Linux: $XDG_DATA_HOME/dtvem (or ~/.local/share/dtvem if unset)
- macOS: ~/.dtvem (familiar to Unix CLI users)
- Windows: %USERPROFILE%\.dtvem (visible and easy to backup)
- Override: DTVEM_ROOT env var works on all platforms

Closes #91
@CalvinAllen CalvinAllen merged commit e9d477f into main Dec 12, 2025
12 checks passed
@CalvinAllen CalvinAllen deleted the feature/xdg-support branch December 12, 2025 19:29
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.

feat(installer): align install paths with platform standards and improve shell guidance

1 participant