From 3fab0f612ae7e702076c51f0d97e2c958ddb8e24 Mon Sep 17 00:00:00 2001 From: Timo Heister Date: Wed, 4 Mar 2020 10:50:54 -0500 Subject: [PATCH] shell script: fix some shellcheck warnings --- contrib/utilities/check_doxygen.sh | 2 +- contrib/utilities/indent_common.sh | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/contrib/utilities/check_doxygen.sh b/contrib/utilities/check_doxygen.sh index b6ccfa2710..b1de396d7e 100755 --- a/contrib/utilities/check_doxygen.sh +++ b/contrib/utilities/check_doxygen.sh @@ -6,4 +6,4 @@ if [ ! -f contrib/utilities/checkdoxygen.py ]; then fi -find doc examples include \( -name "*.h" -o -name "*.dox" \) -print | xargs -n 1 contrib/utilities/checkdoxygen.py +find doc examples include \( -name "*.h" -o -name "*.dox" \) -print0 | xargs -0 -n 1 contrib/utilities/checkdoxygen.py diff --git a/contrib/utilities/indent_common.sh b/contrib/utilities/indent_common.sh index aeca8a4fe0..9b9c642267 100644 --- a/contrib/utilities/indent_common.sh +++ b/contrib/utilities/indent_common.sh @@ -42,7 +42,7 @@ checks() { CLANG_FORMAT_PATH="$(cd "$(dirname "$0")" && pwd)/programs/clang-6/bin" export PATH="${CLANG_FORMAT_PATH}:${PATH}" - if ! [ -x "$(command -v ${DEAL_II_CLANG_FORMAT})" ]; then + if ! [ -x "$(command -v "${DEAL_II_CLANG_FORMAT}")" ]; then echo "*** No clang-format program found." echo "***" echo "*** You can run the './contrib/utilities/download_clang_format'" @@ -272,13 +272,14 @@ export -f fix_permissions process() { + directories=$1 case "${OSTYPE}" in darwin*) - find -E ${1} -regex "${2}" -print0 | + find -E ${directories} -regex "${2}" -print0 | xargs -0 -n 1 -P 10 -I {} bash -c "${3} {}" ;; *) - find ${1} -regextype egrep -regex "${2}" -print0 | + find ${directories} -regextype egrep -regex "${2}" -print0 | xargs -0 -n 1 -P 10 -I {} bash -c "${3} {}" ;; esac @@ -295,7 +296,7 @@ process() process_changed() { LAST_MERGE_COMMIT="$(git log --format="%H" --merges --max-count=1 master)" - COMMON_ANCESTOR_WITH_MASTER="$(git merge-base ${LAST_MERGE_COMMIT} HEAD)" + COMMON_ANCESTOR_WITH_MASTER="$(git merge-base "${LAST_MERGE_COMMIT}" HEAD)" case "${OSTYPE}" in darwin*) -- 2.39.5