fix: search ~/.steam/root and Flatpak data/Steam roots
Layouts from PR #1 (Manjaro report), folded into tools/steam_paths.py. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014TkQMhvEyoFqKzeCC69N6o
This commit is contained in:
@@ -93,6 +93,42 @@ def test_steam_root_without_vdf_still_works():
|
||||
)
|
||||
|
||||
|
||||
def test_legacy_steam_root_symlink():
|
||||
with tempfile.TemporaryDirectory() as home:
|
||||
steam = os.path.join(home, ".steam/root")
|
||||
make_library(steam)
|
||||
env = {"HOME": home}
|
||||
check(
|
||||
steam_paths.find_data_dir(env) == os.path.join(steam, "steamapps/common/Cosmoteer/Data"),
|
||||
"~/.steam/root was not searched",
|
||||
)
|
||||
|
||||
|
||||
def test_flatpak_data_dir_layout():
|
||||
with tempfile.TemporaryDirectory() as home:
|
||||
steam = os.path.join(home, ".var/app/com.valvesoftware.Steam/data/Steam")
|
||||
make_library(steam)
|
||||
env = {"HOME": home}
|
||||
check(
|
||||
steam_paths.find_mods_dir(env) == os.path.join(steam, PROTON_MODS),
|
||||
"Flatpak XDG_DATA_HOME layout (.var/app/.../data/Steam) was not searched",
|
||||
)
|
||||
|
||||
|
||||
def test_library_path_with_spaces():
|
||||
with tempfile.TemporaryDirectory() as home:
|
||||
steam = os.path.join(home, ".local/share/Steam")
|
||||
second = os.path.join(home, "my games/Steam Library")
|
||||
make_library(steam, with_game=False, with_mods=False)
|
||||
make_library(second)
|
||||
write_vdf(steam, [steam, second])
|
||||
env = {"HOME": home}
|
||||
check(
|
||||
steam_paths.find_mods_dir(env) == os.path.join(second, PROTON_MODS),
|
||||
"Library path containing spaces was not handled",
|
||||
)
|
||||
|
||||
|
||||
def test_windows_profile_mods_dir():
|
||||
with tempfile.TemporaryDirectory() as profile:
|
||||
mods = os.path.join(profile, "Saved Games/Cosmoteer/76561190000000000/Mods")
|
||||
|
||||
@@ -27,8 +27,10 @@ PROTON_PROFILE = "compatdata/" + APP_ID + "/pfx/drive_c/users/steamuser/Saved Ga
|
||||
STEAM_ROOTS_UNDER_HOME = [
|
||||
".local/share/Steam",
|
||||
".steam/steam",
|
||||
".steam/root",
|
||||
".steam/debian-installation",
|
||||
".var/app/com.valvesoftware.Steam/.local/share/Steam",
|
||||
".var/app/com.valvesoftware.Steam/data/Steam",
|
||||
".snap/steam/common/.local/share/Steam",
|
||||
"snap/steam/common/.local/share/Steam",
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user