From: Niki Roo Date: Thu, 30 Oct 2025 18:20:52 +0000 (+0100) Subject: fix start.sh option mode X-Git-Url: http://git.nikiroo.be/?a=commitdiff_plain;p=gamiki.git fix start.sh option mode --- diff --git a/gamiki/support/commands.py b/gamiki/support/commands.py index ff15e24..04445d7 100644 --- a/gamiki/support/commands.py +++ b/gamiki/support/commands.py @@ -86,8 +86,15 @@ def qemu(dir: PurePath, link: PurePath, opt: str = None) -> int: return run(cmd, cwd=dir).returncode -def start_sh(start: PurePath) -> int: - cmd = [ start.as_posix() ] +def start_sh(dir: PurePath, link: PurePath, opt: str = None) -> int: + if (opt): + startsh = dir.joinpath(f"start-{opt}.sh") + else: + startsh = dir.joinpath("start.sh") - return run(cmd, cwd=start.parent).returncode + if (not startsh.exists()): + return 404; + + cmd = startsh.as_posix() + return run(cmd, cwd=dir).returncode diff --git a/gamiki/support/support_ext.py b/gamiki/support/support_ext.py index c7399c2..c2ad3c5 100644 --- a/gamiki/support/support_ext.py +++ b/gamiki/support/support_ext.py @@ -8,11 +8,9 @@ class SupportExt(Support): def supports(self, game: Game): return game.dir.joinpath("start.sh").exists() - def _start(self, game: Game, opt: str = None): - start = game.dir.resolve().joinpath("start.sh") - + def _start(self, game: Game, opt: str = None): self._running(game) - rep = start_sh(start) + rep = start_sh(game.dir.resolve(), game.library.dir.resolve(), opt) if (rep != 0): self._error(game, rep)