fix copyright header check with new grep versions
with grep 3.2, a change was introduced that essentially inverts the
exit code returned by grep when using the --files-without-match flag.
To get around this, we calculate our own exit code based on the stdout
output from grep.
closes
@@ -6,4 +6,13 @@ else
FILES=$@
fi
-echo ${FILES} | xargs -n 1 grep --files-without-match "Copyright (c) [0-9]..., Elastic"
+MISSING=$(grep --files-without-match "Copyright (c) [0-9]..., Elastic" ${FILES})
+
+if [[ -z "$MISSING" ]]
+then
+ exit 0
+else
+ echo "Files with missing copyright header:"
+ echo $MISSING
+ exit 1
+fi
