Skip to content

Move settings file to ~/.gabs/ directory with automatic creation#15

Merged
pardeike merged 3 commits intomainfrom
copilot/fix-14
Sep 14, 2025
Merged

Move settings file to ~/.gabs/ directory with automatic creation#15
pardeike merged 3 commits intomainfrom
copilot/fix-14

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Sep 14, 2025

This PR moves all GABS configuration files from platform-specific directories to a unified ~/.gabs/ directory structure as requested in the issue.

Changes Made

Configuration Path Updates:

  • Main config now stored at: ~/.gabs/config.json (all platforms)
  • Bridge configs now stored at: ~/.gabs/<gameId>/bridge.json (all platforms)

Previously used platform-specific locations:

  • Windows: %APPDATA%\GABS\config.json and %APPDATA%\GAB\<gameId>\bridge.json
  • macOS: ~/Library/Application Support/GABS/config.json and ~/Library/Application Support/GAB/<gameId>/bridge.json
  • Linux: ~/.config/gabs/config.json and ~/.local/state/gab/<gameId>/bridge.json

Code Changes:

  • Updated getGamesConfigPath() in games.go to use unified home directory path
  • Updated getConfigDir() in bridgecfg.go to use unified home directory path
  • Removed platform-specific logic and runtime dependency imports
  • Added comprehensive tests to verify new directory structure

Documentation Updates:

  • Updated README.md to reflect new configuration path
  • Updated AGENTS.md to reflect new bridge config locations

Features Preserved

✅ Automatic directory creation when configs are saved
✅ All existing functionality works unchanged
✅ All tests pass with new directory structure
✅ Bridge configuration generation works correctly
✅ Game management commands work as before

Testing

Added TestNewGabsDirectoryStructure test to verify:

  • Config path uses ~/.gabs/config.json format
  • Bridge configs use ~/.gabs/<gameId>/ pattern
  • Directory creation works automatically

All existing tests continue to pass, ensuring no regressions in functionality.

Fixes #14.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Copilot AI and others added 2 commits September 14, 2025 07:18
Co-authored-by: pardeike <853584+pardeike@users.noreply.github.com>
Co-authored-by: pardeike <853584+pardeike@users.noreply.github.com>
Copilot AI changed the title [WIP] Move settings file Move settings file to ~/.gabs/ directory with automatic creation Sep 14, 2025
Copilot AI requested a review from pardeike September 14, 2025 07:20
@pardeike pardeike marked this pull request as ready for review September 14, 2025 07:21
@pardeike pardeike merged commit 00744a2 into main Sep 14, 2025
3 checks passed
@pardeike pardeike deleted the copilot/fix-14 branch September 14, 2025 07:21
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.

Move settings file

2 participants