Merge branch 'autoreload-qmake' into 'main'

Use qmake-qt5 in autoreload if it exists

See merge request mx-moment/moment!27
This commit is contained in:
Maze 2024-01-03 20:15:00 +00:00
commit 8d82431a22

View File

@ -9,6 +9,7 @@ Use `pip3 install --user -U requirements-dev.txt` before running this."""
import os
import subprocess
import shutil
import sys
from contextlib import suppress
from pathlib import Path
@ -47,8 +48,13 @@ def cmd(*parts) -> subprocess.CompletedProcess:
def run_app(args=sys.argv[1:]) -> None:
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):
cmd("qmake", "moment.pro", "CONFIG+=dev")
cmd(QMAKE_CMD, "moment.pro", "CONFIG+=dev")
cmd("make")
cmd("./moment", *args)