Skip to content

Commit

Permalink
Support Sublime Text being installed as a snap (#40)
Browse files Browse the repository at this point in the history
Handle removing the sublime-text path from the end of XDG_RUNTIME_DIR if both sublime and discord are snaps.
  • Loading branch information
stridera authored and FichteFoll committed Apr 24, 2019
1 parent a8fb1c5 commit 0da9976
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions discord_ipc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,8 @@ def _iter_path_candidates():
env_keys = ('XDG_RUNTIME_DIR', 'TMPDIR', 'TMP', 'TEMP')
for env_key in env_keys:
dir_path = os.environ.get(env_key)
if dir_path.endswith('snap.sublime-text'):
dir_path = dir_path[:-17]
if dir_path:
break
else:
Expand Down

0 comments on commit 0da9976

Please sign in to comment.