Generated scripts for posix systems now find the path to gzdoom in case it is not in /usr/bin.

This commit is contained in:
Storm Dragon 2025-03-23 20:56:50 -04:00
parent d10312c0d2
commit 9b8b21cc55

View File

@ -1349,8 +1349,15 @@ class DoomLauncher(QMainWindow):
# Build bash script content
content = ["#!/usr/bin/env bash"]
# Use 'exec' with stdbuf, but with line continuations
content.append("exec stdbuf -oL /usr/bin/gzdoom \\")
# Use 'exec' with stdbuf
try:
gzdoom_path = subprocess.check_output(["which", "gzdoom"],
text=True,
stderr=subprocess.PIPE).strip()
content.append(f"exec stdbuf -oL {gzdoom_path} \\")
except subprocess.CalledProcessError:
# Couldn't get the path, just use the command and hope for the best
content.append("exec stdbuf -oL gzdoom \\")
# Add IWAD
content.append(f" -iwad \"{iwadPath}\" \\")