2020-10-24 17:56:22 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2021-10-05 12:51:08 +00:00
|
|
|
BASEDIR=$(dirname $0)
|
|
|
|
|
|
|
|
|
2020-10-24 17:56:22 +00:00
|
|
|
filter_cmd=("cat")
|
|
|
|
if test -f ".indentignore"; then
|
|
|
|
filter_args=()
|
|
|
|
while read -r line; do
|
|
|
|
if test -n "$line"; then
|
|
|
|
filter_args+=("-e" "$line")
|
|
|
|
fi
|
|
|
|
done < ".indentignore"
|
|
|
|
if [[ ${#filter_args[@]} -gt 0 ]]; then
|
|
|
|
filter_cmd=("grep" "-v" "${filter_args[@]}")
|
|
|
|
fi
|
|
|
|
fi
|
2021-10-05 12:51:08 +00:00
|
|
|
git ls-files "*.c" | "${filter_cmd[@]}" | xargs -d '\n' $BASEDIR/gst-indent
|
2023-02-21 13:24:17 +00:00
|
|
|
|
|
|
|
if test -f ".indent_cpp_list"; then
|
|
|
|
filter_args=()
|
|
|
|
while read -r line; do
|
|
|
|
if test -n "$line"; then
|
|
|
|
filter_args+=("-e" "$line")
|
|
|
|
fi
|
|
|
|
done < ".indent_cpp_list"
|
|
|
|
if [[ ${#filter_args[@]} -gt 0 ]]; then
|
|
|
|
filter_cmd=("grep" "-E" "${filter_args[@]}")
|
|
|
|
git ls-files "*.cpp" | "${filter_cmd[@]}" | xargs -d '\n' $BASEDIR/gst-indent
|
|
|
|
fi
|
|
|
|
fi
|