From eb0d727d34b32187def9f2e645979123123dc8b3 Mon Sep 17 00:00:00 2001 From: loathingKernel <142770+loathingKernel@users.noreply.github.com> Date: Fri, 22 Dec 2023 20:45:35 +0200 Subject: [PATCH] Misc: exclude deleted files in `ui2py.sh` --- misc/ui2py.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/misc/ui2py.sh b/misc/ui2py.sh index 1853fdbf..b89f1215 100755 --- a/misc/ui2py.sh +++ b/misc/ui2py.sh @@ -1,6 +1,10 @@ #!/bin/sh if [ -n "${1}" ]; then + if [ ! -f "${1}" ]; then + echo "${1} does not exist" + exit 0 + fi echo "Generating python file for ${1}" pyuic5 "${1}" -x -o "${1%.ui}.py" sed '/QtCore.QMetaObject.connectSlotsByName/d' -i "${1%.ui}.py" @@ -13,6 +17,10 @@ cd "$(dirname "$0")"/.. || exit changed="$(git diff --name-only HEAD | grep '\.ui')" for ui in $changed; do + if [ ! -f "$ui" ]; then + echo "$ui does not exist. Skipping" + continue + fi echo "Generating python file for ${ui}" pyuic5 "${ui}" -x -o "${ui%.ui}.py" sed '/QtCore.QMetaObject.connectSlotsByName/d' -i "${ui%.ui}.py"