From a431d87dc1a6e85c2409abef56f554d440428f0e Mon Sep 17 00:00:00 2001 From: Kainoa Kanter Date: Thu, 16 Oct 2025 13:36:44 -0700 Subject: [PATCH] fix: cd in precommit hook, not in qmlfmt script --- Bin/dev/qmlfmt.sh | 1 - lefthook.yml | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/Bin/dev/qmlfmt.sh b/Bin/dev/qmlfmt.sh index 6af303d2..1e8bec26 100755 --- a/Bin/dev/qmlfmt.sh +++ b/Bin/dev/qmlfmt.sh @@ -4,6 +4,5 @@ # Can be installed from AUR "qmlfmt-git" # Requires qt6-5compat -cd "$(git rev-parse --show-toplevel)" echo "Formatting $(find . -name "*.qml" | wc -l) files..." find . -name "*.qml" -print0 | xargs -0 -P "$(nproc)" -I {} qmlfmt -e -b 360 -t 2 -i 2 -w {} diff --git a/lefthook.yml b/lefthook.yml index b49937b1..30dcc659 100644 --- a/lefthook.yml +++ b/lefthook.yml @@ -1,4 +1,4 @@ pre-commit: jobs: - name: format qml - run: ./Bin/dev/qmlfmt.sh && git update-index --again + run: cd "$(git rev-parse --show-toplevel)" && ./Bin/dev/qmlfmt.sh && git update-index --again