fix start.sh option mode master
authorNiki Roo <niki@nikiroo.be>
Thu, 30 Oct 2025 18:20:52 +0000 (19:20 +0100)
committerNiki Roo <niki@nikiroo.be>
Thu, 30 Oct 2025 18:20:52 +0000 (19:20 +0100)
gamiki/support/commands.py
gamiki/support/support_ext.py

index ff15e2404b99e8b471f3286d90434b59fe54f09d..04445d7c2a204351b3faa5c3685b774acda40cd6 100644 (file)
@@ -86,8 +86,15 @@ def qemu(dir: PurePath, link: PurePath, opt: str = None) -> int:
 
     return run(cmd, cwd=dir).returncode
 
 
     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
 
 
index c7399c2750ff967c4cdcacf3aa4086adb30b312f..c2ad3c579b34b1adb95fd4ed766c4920c5eee6f0 100644 (file)
@@ -8,11 +8,9 @@ class SupportExt(Support):
     def supports(self, game: Game):
         return game.dir.joinpath("start.sh").exists()
     
     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)
         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)
 
         if (rep != 0):
             self._error(game, rep)