diff --git a/src/deforaos-git-hook.sh b/src/deforaos-git-hook.sh index 0ac0581..4a48973 100755 --- a/src/deforaos-git-hook.sh +++ b/src/deforaos-git-hook.sh @@ -21,6 +21,10 @@ PROGNAME="deforaos-git-hook.sh" #executables GIT="git" +SED="sed" +SORT="sort" +UNIQ="uniq" +WC="wc" #functions @@ -97,9 +101,9 @@ _hook_update() #count the number of commits commit_cnt=$((commit_cnt + 1)) done - all_files=$(echo "$all_files" | sed -e '/^$/d') - files_cnt=$(echo "$all_files" | wc -l) - unique_files_cnt=$(echo "$all_files" | sort | uniq | wc -l) + all_files=$(echo "$all_files" | $SED -e '/^$/d') + files_cnt=$(echo "$all_files" | $WC -l) + unique_files_cnt=$(echo "$all_files" | $SORT | $UNIQ | $WC -l) if [ -n "$branch" ]; then if [ $commit_cnt -eq 1 -a -n "$message" ]; then echo "$repository: $author [$branch] $message ($files_cnt alterations in $unique_files_cnt files)"