Commit 159e0e81 authored by Nirbheek Chauhan's avatar Nirbheek Chauhan 🐜
Browse files

citemplate: Allow spaces in filenames when indenting

Part-of: <!328>
parent 1ab716b7
Pipeline #186758 failed with stages
in 35 minutes and 3 seconds
......@@ -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"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment