HDDS-1803. shellcheck.sh does not work on Mac

Signed-off-by: Anu Engineer <aengineer@apache.org>
This commit is contained in:
Doroszlai, Attila 2019-07-16 05:06:26 +02:00 committed by Anu Engineer
parent d70ec4b5fa
commit d59f2711e0

View File

@ -19,9 +19,14 @@ cd "$DIR/../../.." || exit 1
OUTPUT_FILE="$DIR/../../../target/shell-problems.txt" OUTPUT_FILE="$DIR/../../../target/shell-problems.txt"
mkdir -p "$(dirname "$OUTPUT_FILE")" mkdir -p "$(dirname "$OUTPUT_FILE")"
echo "" > "$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" if [[ "$(uname -s)" = "Darwin" ]]; then
find "./hadoop-ozone" -type f -executable | grep -v target | grep -v node_modules | grep -v py | xargs -n1 shellcheck | tee "$OUTPUT_FILE" 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 if [ "$(cat "$OUTPUT_FILE")" ]; then
exit 1 exit 1