Skip to content

Add macOS and Linux support to the dev symlink helpers - #601

Open
ironsquadronfr-hub wants to merge 1 commit into
swlegion:mainfrom
ironsquadronfr-hub:mac-support
Open

Add macOS and Linux support to the dev symlink helpers#601
ironsquadronfr-hub wants to merge 1 commit into
swlegion:mainfrom
ironsquadronfr-hub:mac-support

Conversation

@ironsquadronfr-hub

Copy link
Copy Markdown

createSymlink and destroySymlink throw on anything that is not Windows,
under a // TODO: Add non-win32 support. that has been there since #230 in
February 2021.

npm start calls createSymlink() right away, so on macOS the repo's own
working command stops before doing anything. Contributors on a Mac cannot use
the documented workflow at all.

This adds the missing platforms:

  • defaultTTSHomeDir() holds the per-platform location in one place
  • macOS: ~/Library/Tabletop Simulator
  • Linux: ~/.local/share/Tabletop Simulator
  • anything else still throws, with the same message

Windows is untouched. It goes through the same steam.homeDir.win32(process.env)
call as before; the only change on that path is that it now lives in one function
instead of being duplicated in two.

Tested on macOS: createSymlink() creates ~/Library/Tabletop Simulator/Saves/TTSDevLink
pointing at dist, and destroySymlink() removes it. I have not been able to
test the Linux path on a real Linux install, so treat that one line as
best-effort; it is the standard TTS data directory there.

For context, this same change is also carried inside #600, which is about the
macOS shader bundles. It has nothing to do with that work and needs no decision
from you, so it seemed better to offer it on its own. If you take it here, I will
rebase #600 on top and drop it from there.

Replace the win32-only guard in createSymlink/destroySymlink with a
defaultTTSHomeDir() dispatch on os.platform(). Resolves the TODO comment
in both functions.

- macOS: ~/Library/Tabletop Simulator
- Linux: ~/.local/share/Tabletop Simulator
- Windows: unchanged (steam.homeDir.win32)

Verified on macOS: npm start creates the TTSDevLink symlink under
~/Library/Tabletop Simulator/Saves/ pointing to ./dist correctly.
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