From 9e67f9b81db96b140f250d84c2168ed311ab38b7 Mon Sep 17 00:00:00 2001 From: Jelte Fennema-Nio Date: Wed, 31 Dec 2025 11:07:58 +0100 Subject: [PATCH v1 2/3] Allow running pgperltidy from any directory pgperltidy was assuming it was run from the root directory of the source tree. This makes it agnostic to that. --- src/tools/pgindent/pgperltidy | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/tools/pgindent/pgperltidy b/src/tools/pgindent/pgperltidy index 87838d6bde3..75c99a84709 100755 --- a/src/tools/pgindent/pgperltidy +++ b/src/tools/pgindent/pgperltidy @@ -4,6 +4,10 @@ set -e +# Determine the directory where this script is located +SCRIPT_DIR=$(cd "$(dirname "$0")" && pwd) +TOOLS_DIR=$(dirname "$SCRIPT_DIR") + # set this to override default perltidy program: PERLTIDY=${PERLTIDY:-perltidy} @@ -13,6 +17,6 @@ if ! $PERLTIDY -v | grep -q $PERLTIDY_VERSION; then exit 1 fi -. src/tools/perlcheck/find_perl_files +. "$TOOLS_DIR/perlcheck/find_perl_files" -find_perl_files "$@" | xargs $PERLTIDY --profile=src/tools/pgindent/perltidyrc +find_perl_files "$@" | xargs $PERLTIDY --profile="$SCRIPT_DIR/perltidyrc" -- 2.52.0