From b336710c46c30b5475daca16950b97a96786128f Mon Sep 17 00:00:00 2001 From: Niki Roo Date: Fri, 26 Dec 2025 14:44:24 +0100 Subject: [PATCH] use _HOME_ for start_sh games --- gamiki/support/commands.py | 11 +++++++++-- gamiki/support/support_gog.py | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/gamiki/support/commands.py b/gamiki/support/commands.py index 04445d7..d0454e9 100644 --- a/gamiki/support/commands.py +++ b/gamiki/support/commands.py @@ -1,6 +1,6 @@ from subprocess import run from shutil import which -from os import environ +from os import environ, mkdir from pathlib import PurePath __programs__: dict = { } @@ -95,6 +95,13 @@ def start_sh(dir: PurePath, link: PurePath, opt: str = None) -> int: if (not startsh.exists()): return 404; + home = dir.joinpath("_HOME_") + if (not home.exists()): + mkdir(home) + + env = environ.copy() + env["HOME"] = home.as_posix() + cmd = startsh.as_posix() - return run(cmd, cwd=dir).returncode + return run(cmd, cwd=dir, env=env).returncode diff --git a/gamiki/support/support_gog.py b/gamiki/support/support_gog.py index 1720775..9b082cc 100644 --- a/gamiki/support/support_gog.py +++ b/gamiki/support/support_gog.py @@ -16,7 +16,7 @@ class SupportGog(Support): # No running, GoG launcher already does it: #self._running(game) - rep = start_sh(start) + rep = start_sh(game.dir.resolve(), start, opt) if (rep != 0): self._error(game, rep) -- 2.27.0