From 8729683fca681841b9a9d6c60c2ab62202ab5835 Mon Sep 17 00:00:00 2001 From: Gerhard Hoffmann Date: Thu, 25 May 2023 16:32:08 +0200 Subject: [PATCH] test for syntax errors --- .githooks/post-checkout | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.githooks/post-checkout b/.githooks/post-checkout index 2a61f62..ab830c8 100755 --- a/.githooks/post-checkout +++ b/.githooks/post-checkout @@ -1,3 +1,4 @@ +#!/bin/bash - # echo "POST-CHECKOUT" # echo "PREV-HEAD=$1" # echo "CURR-HEAD=$2" @@ -25,9 +26,7 @@ if [ -f $CHECKOUT_HISTORY_FILE ]; then echo "DOWNLOAD, /etc/psa_config/DC2C_print04.json, $now, N/A" >> $GIT_UPDATE_LOG echo "DOWNLOAD, /etc/psa_config/DC2C_print29.json, $now, N/A" >> $GIT_UPDATE_LOG echo "DOWNLOAD, /etc/psa_config/DC2C_print32.json, $now, N/A" >> $GIT_UPDATE_LOG - if [ $(wc -l < "$OPKG_COMMANDS_FILE") -gt 0 ]; then - # file not empty - # mark opkg_commdands to be executed by update-tool. + if grep -q . "${OPKG_COMMANDS_FILE}"; then readarray opkg_commands < <(cat $OPKG_COMMANDS_FILE) for opkg_c in "${opkg_commands[@]}"; do test -z $opkg_c && continue;