1
0
Fork 0
mirror of https://github.com/polybar/polybar.git synced 2024-10-27 05:23:39 -04:00
polybar/common/clang-format.sh

21 lines
362 B
Bash
Raw Normal View History

2016-11-25 05:49:37 -05:00
#!/bin/sh
main() {
if [ $# -lt 1 ]; then
echo "$0 DIR..." 1>&2
2016-11-25 05:49:37 -05:00
exit 1
fi
# Search paths
2016-11-25 05:49:37 -05:00
search="${*:-.}"
echo "$0 in $search"
2016-11-25 05:49:37 -05:00
# shellcheck disable=2086
find $search -regex ".*.[c|h]pp" \
-exec printf "\\033[32;1m** \\033[0mFormatting %s\\n" {} \; \
2016-11-25 05:49:37 -05:00
-exec clang-format -style=file -i {} \;
}
main "$@"