Use qmake-qt5 in autoreload if it exists

On Fedora 39, the Qt5 qmake is installed as qmake-qt5. As such, use it
when autoreloading instead of qmake if it exists.
This commit is contained in:
Newbyte 2024-01-02 20:25:54 -06:00
parent f5691fd8be
commit 132b45f670
No known key found for this signature in database
GPG Key ID: 8A700086A9FE41FD

View File

@ -11,6 +11,7 @@ Use `pip3 install --user -U requirements-dev.txt` before running this."""
import os import os
import subprocess import subprocess
import shutil
import sys import sys
from contextlib import suppress from contextlib import suppress
from pathlib import Path from pathlib import Path
@ -49,8 +50,13 @@ def cmd(*parts) -> subprocess.CompletedProcess:
def run_app(args=sys.argv[1:]) -> None: def run_app(args=sys.argv[1:]) -> None:
print("\n\x1b[36m", "" * term_size().columns, "\x1b[0m\n", sep="") print("\n\x1b[36m", "" * term_size().columns, "\x1b[0m\n", sep="")
if shutil.which("qmake-qt5"):
QMAKE_CMD = "qmake-qt5"
else:
QMAKE_CMD = "qmake"
with suppress(KeyboardInterrupt): with suppress(KeyboardInterrupt):
cmd("qmake", "moment.pro", "CONFIG+=dev") cmd(QMAKE_CMD, "moment.pro", "CONFIG+=dev")
cmd("make") cmd("make")
cmd("./moment", "-name", "dev", *args) cmd("./moment", "-name", "dev", *args)