From d59f2711e0f47befc536ad05442d098862e88cef Mon Sep 17 00:00:00 2001 From: "Doroszlai, Attila" Date: Tue, 16 Jul 2019 05:06:26 +0200 Subject: [PATCH] HDDS-1803. shellcheck.sh does not work on Mac Signed-off-by: Anu Engineer --- hadoop-ozone/dev-support/checks/shellcheck.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/hadoop-ozone/dev-support/checks/shellcheck.sh b/hadoop-ozone/dev-support/checks/shellcheck.sh index 1284acd2e5..637a4f863c 100755 --- a/hadoop-ozone/dev-support/checks/shellcheck.sh +++ b/hadoop-ozone/dev-support/checks/shellcheck.sh @@ -19,9 +19,14 @@ cd "$DIR/../../.." || exit 1 OUTPUT_FILE="$DIR/../../../target/shell-problems.txt" mkdir -p "$(dirname "$OUTPUT_FILE")" echo "" > "$OUTPUT_FILE" -find "./hadoop-hdds" -type f -executable | grep -v target | grep -v node_modules | grep -v py | xargs -n1 shellcheck | tee "$OUTPUT_FILE" -find "./hadoop-ozone" -type f -executable | grep -v target | grep -v node_modules | grep -v py | xargs -n1 shellcheck | tee "$OUTPUT_FILE" - +if [[ "$(uname -s)" = "Darwin" ]]; then + find hadoop-hdds hadoop-ozone -type f -perm '-500' +else + find hadoop-hdds hadoop-ozone -type f -executable +fi \ + | grep -v -e target/ -e node_modules/ -e '\.\(ico\|py\|yml\)$' \ + | xargs -n1 shellcheck \ + | tee "$OUTPUT_FILE" if [ "$(cat "$OUTPUT_FILE")" ]; then exit 1