Skip to content

Instantly share code, notes, and snippets.

@adamvduke
Forked from anonymous/snippet.sh
Created April 17, 2011 05:42
Show Gist options
  • Save adamvduke/923782 to your computer and use it in GitHub Desktop.
Save adamvduke/923782 to your computer and use it in GitHub Desktop.
#!/bin/sh
#uncrustify -l OC -c ~/.uncrustify --no-backup $(find -x -E $SRCROOT -not -regex '.*/\.?External/*.*' -name "*.[mh]")
if [ $# -ne 1 ]; then
echo "Please pass the name of the directory to format"
exit 1;
fi
if [ ! -d $1 ]; then
echo "$1 is not a directory"
exit 1;
fi
if [ ! `type -P uncrustify` ]; then
echo "Uncrustify is not a command"
exit 1;
fi
echo Running formatter on $1
uncrustify -l OC -c ~/.uncrustify --no-backup $(find $1 -name "*.[m]")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment