citemplate: Allow spaces in filenames when indenting

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-ci/-/merge_requests/328>
This commit is contained in:
Nirbheek Chauhan 2020-08-06 01:34:18 +05:30
parent 1ab716b71d
commit 159e0e8134

View file

@ -359,19 +359,19 @@ gst indent:
# man indent. grep RETURN VALUE, grab a beer on my behalf...
- indent --version || true
- |
filter_cmd="cat"
filter_cmd=("cat")
if test -f ".indentignore"; then
filter_args=""
filter_args=()
while read -r line; do
if test -n "$line"; then
filter_args="$filter_args -e $line"
filter_args+=("-e" "$line")
fi
done < ".indentignore"
if test -n "$filter_args"; then
filter_cmd="grep -v $filter_args"
if [[ ${#filter_args[@]} -gt 0 ]]; then
filter_cmd=("grep" "-v" "${filter_args[@]}")
fi
fi
find . -name '*.c' | $filter_cmd | xargs gst-indent
find . -name '*.c' | "${filter_cmd[@]}" | xargs -d '\n' gst-indent
- |
if git diff --quiet; then
echo "Code is properly formatted"