Skip to content

fix: use platform-aware data directory instead of Windows-only LOCALAPPDATA#19

Open
DeryFerd wants to merge 1 commit into
vasu-devs:mainfrom
DeryFerd:fix/cross-platform-data-directory
Open

fix: use platform-aware data directory instead of Windows-only LOCALAPPDATA#19
DeryFerd wants to merge 1 commit into
vasu-devs:mainfrom
DeryFerd:fix/cross-platform-data-directory

Conversation

@DeryFerd

@DeryFerd DeryFerd commented May 6, 2026

Copy link
Copy Markdown

What's the problem?

The app hardcodes %LOCALAPPDATA%\BoomBoom as its data directory. That's a Windows-only path — it breaks entirely on macOS and Linux because LOCALAPPDATA doesn't exist there. Even the fallback (os.path.expanduser("~")) dumps the database and assets directly into the user's home directory, which is messy and not how any platform expects apps to store their data.

This also means contributors on macOS or Linux literally can't run the app without manually setting LOCALAPPDATA as an env var, which is a bad onboarding experience for an open-source project.

What this PR does

Adds a _data_dir() helper that returns the correct platform-specific data directory, then replaces every hardcoded BoomBoom/LOCALAPPDATA reference in the codebase with a call to this function.

Platform paths:

OS Path
Windows %LOCALAPPDATA%/JustHireMe
macOS ~/Library/Application Support/JustHireMe
Linux ~/.local/share/justhireme (respects $XDG_DATA_HOME)

Files changed:

  • db/client.py — Added _data_dir() with platform detection via sys.platform. Replaced the old _b = os.path.join(os.environ.get("LOCALAPPDATA", ...), "BoomBoom") with _b = _data_dir().
  • main.py — Two places where asset paths fell back to LOCALAPPDATA/BoomBoom/assets now use _data_dir() via a local wrapper.
  • agents/generator.py — Module-level _assets path now uses _data_dir() instead of hardcoded LOCALAPPDATA.
  • update_settings.py and force_model.py — Standalone scripts that can't import from db.client (they run before the package is set up), so they each have their own inline _data_dir() copy.
  • .gitignore — Added JustHireMe/ and justhireme/ alongside the old BoomBoom/ entry so the new data directories are also ignored.

Migration notes

On Windows, the data directory changes from %LOCALAPPDATA%/BoomBoom to %LOCALAPPDATA%/JustHireMe. Existing users will need to rename or copy their BoomBoom folder to JustHireMe. The old BoomBoom/ entry in .gitignore is kept so it doesn't suddenly show up as untracked.

On macOS and Linux, this is the first time the app has a proper data directory, so no migration needed.

@DeryFerd DeryFerd marked this pull request as ready for review May 6, 2026 20:16
@DeryFerd DeryFerd force-pushed the fix/cross-platform-data-directory branch from ff0602b to 2077cf6 Compare May 6, 2026 20:21
@vasu-devs vasu-devs self-requested a review as a code owner May 14, 2026 20:13
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