Add macOS and Linux support to the dev symlink helpers - #601
Open
ironsquadronfr-hub wants to merge 1 commit into
Open
Add macOS and Linux support to the dev symlink helpers#601ironsquadronfr-hub wants to merge 1 commit into
ironsquadronfr-hub wants to merge 1 commit into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
createSymlinkanddestroySymlinkthrow on anything that is not Windows,under a
// TODO: Add non-win32 support.that has been there since #230 inFebruary 2021.
npm startcallscreateSymlink()right away, so on macOS the repo's ownworking 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~/Library/Tabletop Simulator~/.local/share/Tabletop SimulatorWindows 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/TTSDevLinkpointing at
dist, anddestroySymlink()removes it. I have not been able totest 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.