From 57e281088b41749f1020c5df4ea4359f95536717 Mon Sep 17 00:00:00 2001 From: R1kaB3rN <100738684+R1kaB3rN@users.noreply.github.com> Date: Mon, 29 Apr 2024 10:01:08 -0700 Subject: [PATCH] umu_run: only call list.extend once --- umu/umu_run.py | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/umu/umu_run.py b/umu/umu_run.py index 600e3ef7..2e3dbbf4 100755 --- a/umu/umu_run.py +++ b/umu/umu_run.py @@ -256,25 +256,38 @@ def build_command( err: str = "The following file was not found in PROTONPATH: proton" raise FileNotFoundError(err) + if opts: + command.extend( + [ + root.joinpath("reaper").as_posix(), + f"UMU_ID={env.get('UMU_ID')}", + "--", + local.joinpath("umu").as_posix(), + "--verb", + verb, + "--", + Path(env.get("PROTONPATH")).joinpath("proton").as_posix(), + verb, + env.get("EXE"), + *opts, + ], + ) + return command command.extend( [ root.joinpath("reaper").as_posix(), f"UMU_ID={env.get('UMU_ID')}", "--", - ] - ) - command.extend([local.joinpath("umu").as_posix(), "--verb", verb, "--"]) - command.extend( - [ + local.joinpath("umu").as_posix(), + "--verb", + verb, + "--", Path(env.get("PROTONPATH")).joinpath("proton").as_posix(), verb, env.get("EXE"), - ] + ], ) - if opts: - command.extend([*opts]) - return command