From 6e7501e54c6347b164973779c48458792a501179 Mon Sep 17 00:00:00 2001 From: Gerhard Hoffmann Date: Fri, 26 May 2023 08:03:28 +0200 Subject: [PATCH] testing --- .githooks/post-checkout | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/.githooks/post-checkout b/.githooks/post-checkout index 3939777..ad5e471 100755 --- a/.githooks/post-checkout +++ b/.githooks/post-checkout @@ -29,16 +29,12 @@ if [ -f $CHECKOUT_HISTORY_FILE ]; then if grep -q . "${OPKG_COMMANDS_FILE}"; then readarray opkg_commands < <(cat $OPKG_COMMANDS_FILE) for opkg_c in "${opkg_commands[@]}"; do - # check for empty lines - if grep -qE '^[[:space:]]+$' <<< "${opkg_c}"; then - continue - fi - if [ "${#opkg_c}" -lt 4 ]; then - continue - fi - echo "DDD=${#opkg_c}DDD" - # check if line is not starting with '#' - if ! grep -qE "^\s*[#]+.*$" <<< "$opkg_c"; then + # check for lines longer than 'opkg ' + if [ "${#opkg_c}" -gt 4 ]; then + # comment: spaces, at least one '#' + grep -qE '^[[:space:]]*#+.*$' <<< "$opkg_c" && continue + + echo "DDD=${#opkg_c}DDD" echo -n "EXECUTE, $opkg_c, $now, N/A" | tr -d '\n\r' >> $GIT_UPDATE_LOG 2>&1 echo "" >> $GIT_UPDATE_LOG 2>&1 fi