BizHawkClient: Use `local_path` when autolaunching BizHawk with lua script (#2526)
* BizHawkClient: Change autolaunch path to lua script to use local_path * BizHawkClient: Remove unnecessary call to os.path.join and linting
This commit is contained in:
parent
ce2f9312ca
commit
737686a88d
|
@ -208,19 +208,30 @@ async def _run_game(rom: str):
|
|||
|
||||
if auto_start is True:
|
||||
emuhawk_path = Utils.get_settings().bizhawkclient_options.emuhawk_path
|
||||
subprocess.Popen([emuhawk_path, "--lua=data/lua/connector_bizhawk_generic.lua", os.path.realpath(rom)],
|
||||
cwd=Utils.local_path("."),
|
||||
stdin=subprocess.DEVNULL,
|
||||
stdout=subprocess.DEVNULL,
|
||||
stderr=subprocess.DEVNULL)
|
||||
subprocess.Popen(
|
||||
[
|
||||
emuhawk_path,
|
||||
f"--lua={Utils.local_path('data', 'lua', 'connector_bizhawk_generic.lua')}",
|
||||
os.path.realpath(rom),
|
||||
],
|
||||
cwd=Utils.local_path("."),
|
||||
stdin=subprocess.DEVNULL,
|
||||
stdout=subprocess.DEVNULL,
|
||||
stderr=subprocess.DEVNULL,
|
||||
)
|
||||
elif isinstance(auto_start, str):
|
||||
import shlex
|
||||
|
||||
subprocess.Popen([*shlex.split(auto_start), os.path.realpath(rom)],
|
||||
cwd=Utils.local_path("."),
|
||||
stdin=subprocess.DEVNULL,
|
||||
stdout=subprocess.DEVNULL,
|
||||
stderr=subprocess.DEVNULL)
|
||||
subprocess.Popen(
|
||||
[
|
||||
*shlex.split(auto_start),
|
||||
os.path.realpath(rom)
|
||||
],
|
||||
cwd=Utils.local_path("."),
|
||||
stdin=subprocess.DEVNULL,
|
||||
stdout=subprocess.DEVNULL,
|
||||
stderr=subprocess.DEVNULL
|
||||
)
|
||||
|
||||
|
||||
async def _patch_and_run_game(patch_file: str):
|
||||
|
|
Loading…
Reference in New Issue