Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- function exclude_odd_folders_and_format {
- egrep -v "^Pods|^tools" | tr '\n' '\0' | xargs -0 clang-format -i -style=file
- }
- export -f exclude_odd_folders_and_format
- if [ $# -eq 0 ]; then
- find . -type f -name *.h -o -name *.m -o -name *.mm | sed "s/^\.\///g" | exclude_odd_folders_and_format
- exit 0
- elif [ "$1" == "--only-modified" ]; then
- git status --porcelain | grep -e "^ \\?[AM]" | sed "s/^...//" | grep -E '(.*\.h|.*\.m|.*\.mm)$' | exclude_odd_folders_and_format
- exit 0
- fi
- echo "Unknown argument"
- exit 1
Add Comment
Please, Sign In to add comment