source: flair-dev/tags/latest/scripts/flair_format_dir.sh@ 92

Last change on this file since 92 was 13, checked in by Bayard Gildas, 9 years ago

formatting script + include reformatted

  • Property svn:executable set to *
File size: 412 bytes
Line 
1#! /bin/sh
2DIR=$1
3if [ ! -d $DIR ]; then
4 echo "Directory $DIR not found"
5 exit 1
6fi
7CLANG_FORMAT_CMD=$(locate --regex /clang-format$)
8if [ $? -ne 0 ]; then
9 echo "clang-format command not found. Please install it before running this script."
10 exit 2
11else
12 echo "clang-format binary used is $CLANG_FORMAT_CMD"
13fi
14
15find $DIR \( -name '*.h' -o -name '*.cpp' \) -execdir $CLANG_FORMAT_CMD -style=llvm -i {} +
16
Note: See TracBrowser for help on using the repository browser.