Skip to content

Commit

Permalink
Blindly trust ~/.steam/steam (#69)
Browse files Browse the repository at this point in the history
Ammo now requires this folder to exist. It's okay if it's a symlink to
the folder that contains steamapps.
  • Loading branch information
cyberrumor committed Dec 16, 2024
1 parent 25eb748 commit 4661c85
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions ammo/controller/game.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,17 +169,9 @@ def __init__(self, args):
# ~/.steam/steam is a symlink usually pointing to ~/.local/share/Steam,
# but the location it points to might be different for unknown reasons.
# Trust the symlink location to point to the correct steam install location.
if all(
(
(steam := Path.home() / ".steam" / "steam").exists(),
steam.is_symlink(),
steam.readlink().exists(),
)
):
self.steam = (Path.home() / ".steam" / "steam").resolve() / "steamapps"
else:
# The symlink at ~/.steam/steam was broken. Fallback to a sane default.
self.steam = Path.home() / ".local/share/Steam/steamapps"
# It might not be a symlink at all, steam might just be installed here.
# Permit the absence of it too, in case users only use flatpak.
self.steam = (Path.home() / ".steam" / "steam").resolve() / "steamapps"
self.flatpak = (
Path.home()
/ ".var/app/com.valvesoftware.Steam/.local/share/Steam/steamapps"
Expand Down

0 comments on commit 4661c85

Please sign in to comment.